wugg 1 ano atrás
pai
commit
495af84e72
1 arquivos alterados com 9 adições e 4 exclusões
  1. 9 4
      app/command/reportTips.php

+ 9 - 4
app/command/reportTips.php

@@ -38,14 +38,19 @@ class reportTips extends Command
 		foreach ($depart as $item=>$name){
 			$uidArr =getUidByDepartId($item);
 			$where=["ownerid"=>$uidArr,"companyNo"=>$companyNo,"platform_type"=>1];
-			
 			$tem=[
 				"depart"=>$name,
 				"wpay_fee"=>Db::name("qrd_info")->where($where)->sum('wpay_fee'),
 				"wpay_ainv_fee"=>Db::name("qrd_info")->where($where)->where(["inv_status"=>[2,3]])->sum('wpay_fee'),
-				"ainv_fee"=>Db::name("qrd_info")->where($where)->whereOr([["inv_status","<>",3],['pay_status','<>',3]])->sum('ainv_fee'),
-				"apay_fee"=>Db::name("qrd_info")->where($where)->whereOr([['inv_status','<>',3],['pay_status','<>',3]])->sum('apay_fee'),
-				"ainv_apay_fee"=>Db::name("qrd_info")->where($where)->whereOr([['inv_status','<>',3],['pay_status','<>',3]])->sum(Db::raw("ainv_fee - apay_fee")),
+				"ainv_fee"=>Db::name("qrd_info")->where($where)->where(function ($query){
+					$query->whereOr([['inv_status','<>',3],['pay_status','<>',3]]);
+				})->sum('ainv_fee'),
+				"apay_fee"=>Db::name("qrd_info")->where($where)->where(function ($query){
+					$query->whereOr([['inv_status','<>',3],['pay_status','<>',3]]);
+				})->sum('apay_fee'),
+				"ainv_apay_fee"=>Db::name("qrd_info")->where($where)->where(function ($query){
+					$query->whereOr([['inv_status','<>',3],['pay_status','<>',3]]);
+				})->sum(Db::raw("ainv_fee - apay_fee")),
 				"wpay_send_fee"=>Db::name("qrd_info")->where($where)->where(["sendStatus"=>1])->sum('wpay_fee'),
 				"winv_fee"=>Db::name("qrd_info")->where($where)->sum('winv_fee'),
 				"inv_fee"=>Db::name("qrd_info")->where($where)->sum('inv_fee'),