Ecshop 注册就送红包

2009-10-09
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的方法:促销管理 -- 红包类型 -- 鼠标指到相关的红包 看你浏览器下面的链接地址

扫描二维码分享到微信

在线咨询
联系电话

028-86728035