注册赠送
This commit is contained in:
parent
05cc0b74d3
commit
f8ff5dfacf
@ -1625,13 +1625,12 @@ class Orders extends Base{
|
||||
try {
|
||||
$sysConf = (new SCM())->getSysConfigs();
|
||||
if (date('Y/m/d') == date('Y-m-d', strtotime($sysConf['jiri']))) {
|
||||
$m->setTable('sys_summary');
|
||||
$toPayInfo = $m->getInfo(['id'=>1],'toPaySlow');
|
||||
$sm = Model('common/SysSummary');
|
||||
$toPayInfo = $sm->getInfo(['id'=>1],'toPaySlow');
|
||||
$toPaySlow = (float)$toPayInfo['toPaySlow'];
|
||||
$jiri_get_percent = floatval($sysConf['jiri_get_percent']);
|
||||
$giveValue = round($toPaySlow*((float)$jiri_get_percent/100), 5);
|
||||
// 先扣了
|
||||
$sm = Model('common/SysSummary');
|
||||
// 购户吉日应该获得的“已获优惠券”的值>该购户的“预获优惠券”值的值
|
||||
$vsm = Model('common/Table');
|
||||
$vsm->setTable('user_vouchers_summary');
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user