详情页

ECSHOP 注册就送红包

时间:2024年01月31日

编辑:佚名

1 添加一个红包
2 打开 user.php 查找代码
if (register($username, $password, $email, $other) !== false)
        {
在下面添加代码
复制代码
                        /* 用户注册就发红包 */ 
                $bonus = $db->getRow('SELECT * FROM ' . $ecs->table("bonus_type") . ' WHERE send_type = 0 And type_id = 1 ', true); 
                        if($bonus){ 
                                if(time()<($bonus['send_end_date']+10)){ 
                                        $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); 
                                                } 
                                } 
复制代码
type_id 指 你红包的ID号
查看红包ID的方法:后台 -- 红包类型 -- 鼠标指到相关的红包 看你浏览器下面的链接地址,如图:
相关文章
猜你需要