You've already forked qlg.tsgz.moe
							
							删除无用代码
This commit is contained in:
		| @@ -1519,7 +1519,7 @@ class Orders extends Base{ | ||||
|  | ||||
|                         $vm = new UserVouchers(); | ||||
|  | ||||
|                         $zgSwipeUseReal = boolval(dataConf('zgSwipeUseReal')); | ||||
|                         $zgSwipeUseReal = dataConf('zgSwipeUseReal') != 0; | ||||
|                         $zgSwipeUnless = floatval(dataConf('zgSwipeUnless')); | ||||
|                         $zgSwipeToLevel = (int)$order['helpUserLevel']; | ||||
|                         // 确认是否滑动 | ||||
| @@ -1559,27 +1559,18 @@ class Orders extends Base{ | ||||
|                         $totalMoney = $order['realTotalMoney'];//产品额 | ||||
|                         $buyerPreProductNum = $buyerPreProductNum > $totalMoney ? $totalMoney : $buyerPreProductNum; | ||||
|                         // 10.15添加:助购户的 助购预获 减少的同时 代快付值等额减少 | ||||
|                         if ((int)$order["helpUserLevel"] === 1) { | ||||
|                             Db::name("orders")->where(compact('orderId'))->update([ | ||||
|                                 "helpGetCount"=>$buyerPreProductNum, | ||||
|                                 "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), | ||||
|                             ]);} | ||||
|                         else { | ||||
|                             Db::name("orders")->where(compact('orderId'))->update([ | ||||
|                                 "helpGetCount"=>$buyerPreProductNum*((int)$order["helpUserLevel"])*(float)dataConf("helpSaleCalBase"), | ||||
|                                 "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), | ||||
|                             ]); | ||||
|                         if ($order["helpUserLevel"] > 1) { | ||||
|                             $buyerPreProductNum = $buyerPreProductNum*((int)$order["helpUserLevel"])*(float)dataConf("helpSaleCalBase"); | ||||
|                         } | ||||
|                         Db::name("orders")->where(compact('orderId'))->update([ | ||||
|                             "helpGetCount"=>$buyerPreProductNum, | ||||
|                             "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), | ||||
|                         ]); | ||||
|  | ||||
|                         // step 5 平台送自己:10000×N“助购预获”, | ||||
|                         //                   10000“预获产品券”; | ||||
|                         //                   10000×0.4×0.5×0.5=1000“预获优惠券”。 | ||||
|                         if ((int)$order["helpUserLevel"] === 1) { | ||||
|                             $vm->insertHelpSaleNotice($userId, $orderId, $buyerPreProductNum, | ||||
|                                 '订单【'.$order['orderNo'].'】购户购物所得', 1); | ||||
|                         } else { | ||||
|                             $vm->insertHelpSaleNotice($userId, $orderId, $buyerPreProductNum*((int)$order["helpUserLevel"])*(float)dataConf("helpSaleCalBase"), | ||||
|                                 '订单【'.$order['orderNo'].'】购户购物所得', 1); | ||||
|                         } | ||||
|                         $vm->insertHelpSaleNotice($userId, $orderId, $buyerPreProductNum, '订单【'.$order['orderNo'].'】购户购物所得', 1); | ||||
|  | ||||
|                         // step 8 平台送自己的上第N层:扣减“助购预获”、“预获产品券”各10000×0.4×0.5=2000, | ||||
|                         //                            同时添加10000×0.4×0.5=2000“已获产品券”。 | ||||
|   | ||||
| @@ -8,48 +8,7 @@ class Index extends Base{ | ||||
| 	protected $beforeActionList = [ | ||||
|           'checkAuth' =>  ['only'=>'getsysmessages'] | ||||
|     ]; | ||||
|     public function index(){    | ||||
|       $pay['needPay'] =200;  | ||||
|       $userId=1;//$this->getUserId() | ||||
|       //产品券 | ||||
|       $buyerMaxProductScale = round(dataConf('buyerMaxProductScale')*0.01,2); | ||||
|       $pay['maxProduct'] = $pay['needPay'] * $buyerMaxProductScale;//最大可用产品券 | ||||
|       $pay['productHandlingFee'] = round(dataConf('useHasHandlingFee')*0.01,2);//产品券手续费 | ||||
|       $pay['productTaxFee'] = round(dataConf('useHasTaxFee')*0.01,2);//产品券税费 | ||||
|       $pay['maxAllProduct'] = $this->getMaxNum($pay['maxProduct'],(1-$pay['productHandlingFee']-$pay['productTaxFee'] ));//加上手续费,税费最多扣除产品券 | ||||
|  | ||||
|       //优惠券 | ||||
|       $pay['maxCoupons'] = $pay['needPay'] - $pay['maxProduct'] ;//最大可用其他券,优惠券+旺旺券+现金券 | ||||
|       $pay['coupousHandlingFee'] = round(dataConf('useHasHandlingFee')*0.01,2);//优惠券手续费 | ||||
|       $pay['coupousTaxFee'] = round(dataConf('useHasTaxFee')*0.01,2);//优惠券税费 | ||||
|       $pay['maxAllCoupons'] = $this->getMaxNum($pay['maxCoupons'],(1-$pay['coupousHandlingFee']-$pay['coupousTaxFee'] ));//加上手续费,税费最多扣除优惠券 | ||||
|  | ||||
|       $pay['money']['useMoney'] = 0; | ||||
|       $pay['wang']['useWang'] = 0; | ||||
|       //实际应用最大的产品券 | ||||
|       $userInfo = getUserInfo(['userId'=>$userId],'couponsNum,productNum,wangNum'); | ||||
|       $pay['product']['useProduct'] = $userInfo['productNum'] >= $pay['maxAllProduct'] ? $pay['maxAllProduct'] : $userInfo['productNum']; | ||||
|       $pay['product']['useProductHandlingFee'] = $pay['product']['useProduct'] * $pay['productHandlingFee'];//产品券手续费 | ||||
|       $pay['product']['useProductTaxFee']  = $pay['product']['useProduct'] * $pay['productTaxFee']; | ||||
|       $pay['product']['useProductOk'] = $pay['product']['useProduct'] - $pay['product']['useProductHandlingFee'] - $pay['product']['useProductTaxFee']; | ||||
|  | ||||
|       //实际应用最大的优惠券 | ||||
|       $pay['coupons']['useCoupons'] = $userInfo['couponsNum'] >= $pay['maxAllCoupons'] ? $pay['maxAllCoupons'] : $userInfo['couponsNum']; | ||||
|       $pay['coupons']['useCouponsHandlingFee'] = round($pay['coupons']['useCoupons'] * $pay['coupousHandlingFee'],2);//产品券手续费 | ||||
|       $pay['coupons']['useCouponsTaxFee']  = round($pay['coupons']['useCoupons'] * $pay['coupousTaxFee'],2); | ||||
|       $pay['coupons']['useCouponsOk'] = $pay['coupons']['useCoupons'] - $pay['coupons']['useCouponsHandlingFee'] - $pay['coupons']['useCouponsTaxFee']; | ||||
|       $remNum = $pay['needPay'] - $pay['product']['useProduct'] - $pay['coupons']['useCouponsHandlingFee']; | ||||
|       if($remNum > 0 ){ | ||||
|         //旺旺券 | ||||
|         $pay['wang']['useWang'] = $userInfo['wangNum'] >= $remNum ? $remNum : $userInfo['wangNum']; | ||||
|         $remNum = $pay['needPay'] - $pay['product']['useProduct'] - $pay['coupons']['useCouponsHandlingFee']-$pay['wang']['useWang']; | ||||
|         if($remNum > 0 ){ | ||||
|           $pay['money']['useMoney'] = $remNum; | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       // dump($pay); | ||||
|  | ||||
|     public function index(){ | ||||
|     	return $this->fetch('index'); | ||||
|     } | ||||
|     /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user