|
|
@@ -145,6 +145,31 @@ class InventoryCompareService
|
|
|
if (!$inventoryCompares)return null;
|
|
|
return $inventoryCompares;
|
|
|
}
|
|
|
+ private function conditionQueryInventoryCompare(array $param){
|
|
|
+ $differ=$param['differ']??'';
|
|
|
+ if ($differ=='有'){
|
|
|
+ $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
+ $query->with('barcodes');
|
|
|
+ }])->where('differ','>',0)->orderByDesc('id');
|
|
|
+ }elseif ($differ=='无'){
|
|
|
+ $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
+ $query->with('barcodes');
|
|
|
+ }])->where('differ','<',0)->orderByDesc('id');
|
|
|
+ }else{
|
|
|
+ $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
+ $query->with('barcodes');
|
|
|
+ }])->orderByDesc('id');
|
|
|
+ }
|
|
|
+ unset($param['differ']);
|
|
|
+ $columnQueryRules=[
|
|
|
+ 'owner_id' => ['multi' => ','],
|
|
|
+ 'date_start' => ['alias' => 'created_at' , 'startDate' => ' 00:00:00'],
|
|
|
+ 'date_end' => ['alias' => 'created_at' , 'endDate' => ' 23:59:59'],
|
|
|
+ 'mission_code' => ['timeLimit' => 20],
|
|
|
+ ];
|
|
|
+ $inventoryCompares = app(QueryService::class)->query($param,$inventoryCompares,$columnQueryRules);
|
|
|
+ return $inventoryCompares;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -209,29 +234,4 @@ class InventoryCompareService
|
|
|
// return $inventoryCompare;
|
|
|
// }
|
|
|
//
|
|
|
-// private function conditionQueryInventoryCompare(array $param){
|
|
|
-// $differ=$param['differ']??'';
|
|
|
-// if ($differ=='有'){
|
|
|
-// $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
-// $query->with('barcodes');
|
|
|
-// }])->where('differ','>',0)->orderByDesc('id');
|
|
|
-// }elseif ($differ=='无'){
|
|
|
-// $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
-// $query->with('barcodes');
|
|
|
-// }])->where('differ','<',0)->orderByDesc('id');
|
|
|
-// }else{
|
|
|
-// $inventoryCompares = InventoryCompare::query()->with(['owner','commodity'=>function($query){
|
|
|
-// $query->with('barcodes');
|
|
|
-// }])->orderByDesc('id');
|
|
|
-// }
|
|
|
-// unset($param['differ']);
|
|
|
-// $columnQueryRules=[
|
|
|
-// 'owner_id' => ['multi' => ','],
|
|
|
-// 'date_start' => ['alias' => 'created_at' , 'startDate' => ' 00:00:00'],
|
|
|
-// 'date_end' => ['alias' => 'created_at' , 'endDate' => ' 23:59:59'],
|
|
|
-// 'mission_code' => ['timeLimit' => 20],
|
|
|
-// ];
|
|
|
-// $inventoryCompares = app(QueryService::class)->query($param,$inventoryCompares,$columnQueryRules);
|
|
|
-// return $inventoryCompares;
|
|
|
-// }
|
|
|
}
|