注册赠送

This commit is contained in:
2020-12-06 14:09:55 +08:00
parent 05cc0b74d3
commit f8ff5dfacf
2 changed files with 19 additions and 3 deletions

View File

@ -438,6 +438,23 @@ class Users extends Base{
WSTSendMsg($userId,str_replace($find,$replace,$tpl['tplContent']),['from'=>0,'dataId'=>0]);
}
create_tree($userId,$pInfo['userId']);
//
//一、当【助购值】的值大于设置的【全亮共欢迎您助购所得】值时,按设置值给予。
//二、当【助购值】的值小于设置的【全亮共欢迎您助购所得】值时,按【助购值】全值给予即可。
$sm = Model('common/SysSummary');
$vm = new UserVouchers();
// registerMaxGetProductCoupon
$get = (float)dataConf('helpSaleCouponsCalBase');
$ssm = Model('common/Table');
$ssm->setTable('sys_summary');
$toPayInfo = $ssm->getInfo(['id'=>1],'toPaySlow');
$toPaySlow = (float)$toPayInfo['toPaySlow'];
if ($get > $toPaySlow)$get = $toPaySlow;
if ($get > 0) {
$sm->addSysSummary(0,$get,2,'用户【'.$userId.'】注册赠送所扣');
$vm->insertAlreadyVouchersNotice($userId, 0, $get, 0,
'全亮共欢迎您助购所得', 1);
}
Db::commit();
flock($fp,LOCK_UN);
fclose($fp);