1、添加语言包:languages/zh_cn/bonus.php 在46行下方添加 $_LANG['send_by'][SEND_BY_LOGIN] = '按照登录时间段发放'; $_LANG['send_by'][SEND_BY_NEW] = '按照新注册时间段发放';
2、添加参数识别 includes/inc_constant.php 在115行下方添加 define('SEND_BY_LOGIN', 4); // 按照登录时间段发放 define('SEND_BY_NEW', 5); // 按照新注册时间段发放
3、添加函数片段:includes/liv_main.php
4、添加新注册判断 includes/lib_passport.php
5、添加规则红包判断函数 后台:includes/lib_main.php 约238行:
/**
-
取得红包类型数组(用于生成下拉列表)
-
@return array 分类数组 bonus_typeid => bonus_type_name */ function get_bonus_type_login() { $bonus = array(); $sql = 'SELECT type_id, type_name, type_money FROM ' . $GLOBALS['ecs']->table('bonus_type') . ' WHERE send_type = 4'; $res = $GLOBALS['db']->query($sql);
while ($row = $GLOBALS['db']->fetchRow($res)) { $bonus[$row['type_id']] = $row['type_name'].' [' .sprintf($GLOBALS['_CFG']['currency_format'], $row['type_money']).']'; }
return $bonus; }
/**
-
取得红包类型数组(用于生成下拉列表)
-
@return array 分类数组 bonus_typeid => bonus_type_name */ function get_bonus_type_new() { $bonus = array(); $sql = 'SELECT type_id, type_name, type_money FROM ' . $GLOBALS['ecs']->table('bonus_type') . ' WHERE send_type = 5'; $res = $GLOBALS['db']->query($sql);
while ($row = $GLOBALS['db']->fetchRow($res)) { $bonus[$row['type_id']] = $row['type_name'].' [' .sprintf($GLOBALS['_CFG']['currency_format'], $row['type_money']).']'; }
return $bonus; }
6、后台添加两则判断 bonus.php
7、后台模板添加 templates/bonus_tyoe_info.htm