ECSHOP 注册就送红包

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的方法:后台 -- 红包类型 -- 鼠标指到相关的红包 看你浏览器下面的链接地址,如图:


360截图20120813201736652.jpg

 

 

posted on 2012-12-10 17:31  ECshop商城二次开发博客  阅读(341)  评论(0编辑  收藏  举报

导航