You've already forked qlg.tsgz.moe
							
							数据库存储备注
This commit is contained in:
		| @@ -1510,7 +1510,7 @@ class Orders extends Base{ | ||||
|  | ||||
|                         // step 2 商户支付优惠款给平台:10000×0.4=4000 | ||||
|                         // 10.15添加 优惠款 全额进入 代快付值 | ||||
|                         $sm->addSysSummary($calBaseNum,0,1); | ||||
|                         $sm->addSysSummary($calBaseNum,0,1,'助购吧购物,订单号ID['.$orderId.'],优惠款全额进入代快付值'); | ||||
|  | ||||
|                         $vm = new UserVouchers(); | ||||
|  | ||||
| @@ -1527,7 +1527,7 @@ class Orders extends Base{ | ||||
|                         if((int)$order["helpUserLevel"]!==0){ | ||||
|                             $vm->insertHelpSaleNotice($order["helpUserId"], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), | ||||
|                                 '预获助购转换所扣', 0); | ||||
|                             $sm->addSysSummary($calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100),0,2); | ||||
|                             $sm->addSysSummary($calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100),0,2,'订单ID['.$orderId.']:平台送给购户的上N层用户ID['.$order["helpUserId"].']'); | ||||
|                             $vm->insertVouchersNotice($order['helpUserId'], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), 0, | ||||
|                                 '预获产品券转换所扣',0); | ||||
|                             $vm->insertAlreadyVouchersNotice($order['helpUserId'], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), 0, | ||||
|   | ||||
| @@ -28,7 +28,7 @@ class Settlements extends Base | ||||
|         //加入快代付值 | ||||
|         $fastScale = dataConf('fastPayInSaleScale'); | ||||
|         $fastNum = round($discountMoney * ($fastScale*0.01),5); | ||||
|         Model('SysSummary')->addToPayFast($orderId,$fastNum,$fastScale); | ||||
|         Model('SysSummary')->addToPayFast($orderId,$fastNum,$fastScale,'订单ID['.$orderId.']优惠款加入代快(即时)'); | ||||
|         //获取产品额 | ||||
|         $totalMoney = $order->realTotalMoney;//产品额 | ||||
|         if(2 != $order->goodsType){//助微吧商品不给购户券值 | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use think\Db; | ||||
|  * 系统数据 | ||||
|  */ | ||||
| class SysSummary extends Base{ | ||||
|     public function addToPayFast($orderId,$payFastNum,$fastScale){ | ||||
|     public function addToPayFast($orderId,$payFastNum,$fastScale,$sm=''){ | ||||
|     	$noticeData['orderId'] = $orderId; | ||||
|     	$noticeData['toPayFast'] = $payFastNum; | ||||
|     	$noticeData['fastScale'] = $fastScale; | ||||
| @@ -14,7 +14,7 @@ class SysSummary extends Base{ | ||||
|     	Db::name('sys_notice')->insert($noticeData); | ||||
|     	//   原:当购户“预获优惠券”、“预获产品券”的值同时≤15元时,所获“已获优惠券”、“已获产品券”转入代快付值 | ||||
|         // 改为:当购户“预获优惠券”、“预获产品券”的值同时≤15元时,所获“已获优惠券”、“已获产品券”转入代慢付值 | ||||
|         $this->addSysSummary($payFastNum, 0); | ||||
|         $this->addSysSummary($payFastNum, 0,$sm); | ||||
|     } | ||||
|     /** | ||||
|      * 添加系统数据 | ||||
| @@ -22,9 +22,9 @@ class SysSummary extends Base{ | ||||
|      * @param integer $payFastSlow [代慢付值] | ||||
|      * @param integer $isAdd [1加2减] | ||||
|      */ | ||||
|     public function addSysSummary($payFastNum=0,$payFastSlow=0,$isAdd=1){ | ||||
|     public function addSysSummary($payFastNum=0,$payFastSlow=0,$isAdd=1,$sm=''){ | ||||
|         if($payFastNum){ | ||||
|             $this->addSysLog($payFastNum,1,$isAdd); | ||||
|             $this->addSysLog($payFastNum,1,$isAdd,$sm); | ||||
|             if(1 == $isAdd){ | ||||
|                 $this->where(['id'=>1])->setInc('toPayFast',$payFastNum); | ||||
|             }else{ | ||||
| @@ -32,7 +32,7 @@ class SysSummary extends Base{ | ||||
|             }          | ||||
|         } | ||||
|         if($payFastSlow){ | ||||
|             $this->addSysLog($payFastSlow,2,$isAdd); | ||||
|             $this->addSysLog($payFastSlow,2,$isAdd,$sm); | ||||
|             if(1 == $isAdd){ | ||||
|                 $this->where(['id'=>1])->setInc('toPaySlow',$payFastSlow); | ||||
|             }else{ | ||||
| @@ -47,11 +47,12 @@ class SysSummary extends Base{ | ||||
|      * @param [type]  $changeType   [1加 2减] | ||||
|      * @param integer $adminId [操作人员ID,0为系统] | ||||
|      */ | ||||
|     public function addSysLog($num,$type,$changeType=1,$adminId=0){ | ||||
|     public function addSysLog($num,$type,$changeType=1,$sm='',$adminId=0){ | ||||
|         $data['num'] = $num; | ||||
|         $data['type'] = $type; | ||||
|         $data['changeType'] = $changeType; | ||||
|         $data['adminId'] = $adminId; | ||||
|         $data['remark'] = $sm; | ||||
|         $data['createTime'] = time(); | ||||
|         Db::name('log_sys_data')->insert($data); | ||||
|     } | ||||
|   | ||||
| @@ -50,10 +50,10 @@ class UserVouchers extends Base{ | ||||
| 			if($toPaySum > $maxPayNum){ | ||||
| 				//加入代慢付值 | ||||
| 				$addPaySlow = round($toPaySum - $maxPayNum,5); | ||||
| 				$sm->addSysSummary(0,$addPaySlow); | ||||
| 				$sm->addSysSummary(0,$addPaySlow,1,'应释放总额大于最大释放总额'); | ||||
| 			} | ||||
| 			//扣减系统释放值 | ||||
| 			$sm->addSysSummary($payFast,$paySlow,2); | ||||
| 			$sm->addSysSummary($payFast,$paySlow,2,'扣减系统释放值'); | ||||
| 			//取最小值作为总释放额 | ||||
| 			$payNum = min($maxPayNum,$toPaySum); | ||||
|             if($payNum==0) return; | ||||
| @@ -79,7 +79,7 @@ class UserVouchers extends Base{ | ||||
|                 //都小于15不统计,直接加入代慢付 | ||||
|                 if($v['expectedProductNum'] <= $minNumer && $v['expectedCouponsNum'] <= $minNumer){ | ||||
|                     $toSlowNum = round($personNum * ($v['expectedProductNum'] + $v['expectedCouponsNum']),2); | ||||
|                     $sm->addSysSummary(0,$toSlowNum); | ||||
|                     $sm->addSysSummary(0,$toSlowNum,1,'用户ID['.$v['userId'].']双预获券都小于15,直接加入代慢付'); | ||||
|                     continue; | ||||
|                 } | ||||
|                 if($v['expectedProductNum'] < $minNumer){//预获产品券小于15; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user