A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > Ecshop > ecshop教程:注册送红包实现代码

ecshop教程:注册送红包实现代码

时间:2015-04-14 17:12作者:zhao人气:65

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

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

代码如下:

//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

标签ecshop,教程,注册,红包,实现,代码,user.php

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号