上滑逻辑更新

This commit is contained in:
Jerry Yan 2020-12-04 16:50:59 +08:00
parent 7f330fe4f2
commit cede6f3943

View File

@ -1534,14 +1534,16 @@ class Orders extends Base{
if($helpSaleInfo===null){$userHelpGet=0;} if($helpSaleInfo===null){$userHelpGet=0;}
else{$userHelpGet = (float)$helpSaleInfo['helpSaleNum'];} else{$userHelpGet = (float)$helpSaleInfo['helpSaleNum'];}
while ($userHelpGet < $zgSwipeUnless) { while ($userHelpGet < $zgSwipeUnless) {
$isZgSwipe = true;
$parentData = Db::name('user_trees')->where(array('uid'=>$curZgSwipeTo))->find(); $parentData = Db::name('user_trees')->where(array('uid'=>$curZgSwipeTo))->find();
// 无上级,不滑动 // 无上级,不滑动
if (empty($parentData)) break; if (empty($parentData)) break;
$curZgSwipeTo = $parentData['pid'];
// 用户ID是1或者0,不滑动了 // 用户ID是1或者0,不滑动了
if ($curZgSwipeTo != 1 && $curZgSwipeTo != 0) break; if ($parentData['pid'] != 1 && $parentData['pid'] != 0) break;
// 只有进行了滑动,才进行赋值
$isZgSwipe = true;
$curZgSwipeTo = $parentData['pid'];
$zgSwipeToLevel ++; $zgSwipeToLevel ++;
// 继续判断
$helpSaleInfo = Db::name("user_vouchers_summary")->where(['userId'=>$curZgSwipeTo])->find(); $helpSaleInfo = Db::name("user_vouchers_summary")->where(['userId'=>$curZgSwipeTo])->find();
if($helpSaleInfo===null){$userHelpGet=0;} if($helpSaleInfo===null){$userHelpGet=0;}
else{$userHelpGet = (float)$helpSaleInfo['helpSaleNum'];} else{$userHelpGet = (float)$helpSaleInfo['helpSaleNum'];}
@ -1550,8 +1552,8 @@ class Orders extends Base{
} }
if ($zgSwipeUseReal) { if ($zgSwipeUseReal) {
$order['helpUserLevel'] = $zgSwipeToLevel; $order['helpUserLevel'] = $zgSwipeToLevel;
$order['helpUserId'] = $curZgSwipeTo;
} }
$order['helpUserId'] = $curZgSwipeTo;
// 20201203预获产品券 * 层数*基数 // 20201203预获产品券 * 层数*基数
@ -1585,13 +1587,23 @@ class Orders extends Base{
//现在 计算被助购户获得【已获产品券】的算式为u×n%×1-50%-20% //现在 计算被助购户获得【已获产品券】的算式为u×n%×1-50%-20%
// 根据设置新添的【购户获得已获优惠券是在助购吧购的物的优惠款的20%】, // 根据设置新添的【购户获得已获优惠券是在助购吧购的物的优惠款的20%】,
// 同时计算该助购户自己获得【已获优惠券】的算式为u×n%×20% // 同时计算该助购户自己获得【已获优惠券】的算式为u×n%×20%
$sm->addSysSummary($yhcpq_zh,0,2,'订单【'.($order['orderNo']?:'--').'】预获产品券被助购转换所扣'); if ($isZgSwipe) {
$vm->insertHelpSaleNotice($order["helpUserId"], $orderId, $yhyhq_zh, $sm->addSysSummary($yhcpq_zh,0,2,'订单【'.($order['orderNo']?:'--').'】预获产品券被助购上滑转换所扣');
'预获助购被助购转换所扣', 0); $vm->insertHelpSaleNotice($order["helpUserId"], $orderId, $yhyhq_zh,
$vm->insertVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0, '预获助购被助购上滑转换所扣', 0);
'预获产品券被助购转换所扣',0); $vm->insertVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0,
$vm->insertAlreadyVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0, '预获产品券被助购上滑转换所扣',0);
'订单【'.($order['orderNo']?:'--').'】预获产品券被助购转换所得',1); $vm->insertAlreadyVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0,
'订单【'.($order['orderNo']?:'--').'】预获产品券被助购上滑转换所得',1);
} else {
$sm->addSysSummary($yhcpq_zh,0,2,'订单【'.($order['orderNo']?:'--').'】预获产品券被助购转换所扣');
$vm->insertHelpSaleNotice($order["helpUserId"], $orderId, $yhyhq_zh,
'预获助购被助购转换所扣', 0);
$vm->insertVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0,
'预获产品券被助购转换所扣',0);
$vm->insertAlreadyVouchersNotice($order['helpUserId'], $orderId, $yhcpq_zh, 0,
'订单【'.($order['orderNo']?:'--').'】预获产品券被助购转换所得',1);
}
// 同时计算该助购户自己获得【已获优惠券】的算式为u×n%×20% // 同时计算该助购户自己获得【已获优惠券】的算式为u×n%×20%
$sm->addSysSummary($yhyhq_zh,0,2,'订单【'.($order['orderNo']?:'--').'】预获优惠券助购转换所扣'); $sm->addSysSummary($yhyhq_zh,0,2,'订单【'.($order['orderNo']?:'--').'】预获优惠券助购转换所扣');
$vm->insertHelpSaleNotice($userId, $orderId, $yhyhq_zh, $vm->insertHelpSaleNotice($userId, $orderId, $yhyhq_zh,