| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -164,7 +164,7 @@ class VerificationController extends Controller | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->where('order_id', $order->id) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->with('supplier') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->select('*') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->selectRaw('sum(price) as sum_price,sum(service_persons) as sum_persons') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->selectRaw('sum(price) as sum_price,sum(service_persons * num) as sum_persons') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->groupBy('supplier_id') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									->get(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								foreach ($orderItem as $v) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -206,15 +206,15 @@ class VerificationController extends Controller | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//	}
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//}
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$supplier = Supplier::query()->where('id', $v->supplier_id)->lockForUpdate()->first(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$supplier = Supplier::query()->where('id', $v->supplier_id)->lockForUpdate()->first(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//处理交易金
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if ($order->single_price > 0 && $v->sum_persons > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										//计算交易金
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$deposit = bcmul($order->single_price,$v->sum_persons,6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										//流水
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$statementCreate[] = $service->createByOrder( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													$deposit, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													bcmul($deposit, -1, 6), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													StatementType::DEPOSIT, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													$v->supplier_id, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													DemandTraits::$col[1], | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -222,10 +222,11 @@ class VerificationController extends Controller | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
													StatementTraits::$type[0] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
												); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										//扣
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$supplierPrice = bcsub($supplierPrice,$deposit,6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$supplier->balance = bcadd($supplier->deposit_used, $supplierPrice, 6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$supplier->balance = bcsub($supplier->deposit_frozen, $supplierPrice, 6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										$supplier->balance = bcsub($supplier->balance,$deposit,6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										//$supplier->balance = bcadd($supplier->deposit_used, $supplierPrice, 6);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										//$supplier->balance = bcsub($supplier->deposit_frozen, $supplierPrice, 6);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$supplier->balance = bcadd($supplier->balance, $supplierPrice, 6); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$supplier->save(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |