首页 > 运营 > 建站经验 > 正文

ecshop教程:实现注册送红包

2019-11-02 15:52:36
字体:
来源:转载
供稿:网友

有时候我们在使用ecshop过程中,一些推广优惠,这里特分享下实现代码,需要的朋友可以参考下

在user.php 的注册成功信息显示前面,大概是 show_message(sprintf($_LANG['register_success'].............前面加入

//phpsir 1111

$bonus_type_id=1;

$bonus = $db->getRow('SELECT * FROM ' . $ecs->table("bonus_type") . " WHERE send_type = 0 And type_id = $bonus_type_id", 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); } }

//phpsir 1111_end

注意下下面的 $bonus_type_id = 1; 需要先在后台加入对应的红包的id

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表