1.首先在后台添加红包。如图:
2.修改文件。user.php
找到:228 行左右
- if (register($username, $password, $email, $other) !== false)
- {
复制代码
添加:
- if (register($username, $password, $email, $other) !== false)
- {
- /* 用户注册就发红包 */
- $bonus = $db->getRow('SELECT * FROM ' . $ecs->table("bonus_type") . ' WHERE send_type = 0', true);
- if($bonus){
- if(time()<($bonus['send_end_date']+28800)){
- $sql = "INSERT INTO " . $ecs->table('user_bonus') .
- "(bonus_type_id, bonus_sn, user_id, used_time, order_id, emailed) " .
- "VALUES ('$bonus[type_id]', 0, '$_SESSION[user_id]', 0, 0, 0)";
- $db->query($sql);
- }
- }
复制代码
|
(责任编辑:最模板) |