|
|
@@ -311,17 +311,27 @@ class TestController extends Controller
|
|
|
|
|
|
public function inventory()
|
|
|
{
|
|
|
- $location='H05-35-04';
|
|
|
- $inventoryAccountId=792;
|
|
|
- $barcode='6973244250033';
|
|
|
- $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
|
|
|
- ->whereHas('commodity',function($query)use($barcode){
|
|
|
- $query->whereHas('barcodes',function($sql)use($barcode){
|
|
|
- $sql->where('code','=',$barcode);
|
|
|
- });
|
|
|
- })->where('location',$location)->where('inventory_account_id',$inventoryAccountId)->toSql();
|
|
|
- dd($inventoryAccountMission);
|
|
|
+ $location='B15-01-01';
|
|
|
+ $taskId=1;
|
|
|
+ $barcode='Fxdsc';
|
|
|
+ $start=microtime(true);
|
|
|
+// $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
|
|
|
+// ->whereHas('commodity',function($query)use($barcode){
|
|
|
+// $query->whereHas('barcodes',function($sql)use($barcode){
|
|
|
+// $sql->where('code','=',$barcode);
|
|
|
+// });
|
|
|
+// })->where('location',$location)->where('inventory_account_id',$taskId)->first();
|
|
|
+//
|
|
|
|
|
|
+ $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
|
|
|
+ ->whereIn('commodity_id',function($query)use($barcode){
|
|
|
+ $query->from('commodity_barcodes')->select('commodity_id')->where('code',$barcode);
|
|
|
+ })->where('location',$location)
|
|
|
+ ->where('inventory_account_id',$taskId)
|
|
|
+ ->where('checked','否')
|
|
|
+ ->first();
|
|
|
+ $end=microtime(true);
|
|
|
+ dump(round($end-$start,3),$inventoryAccountMission);
|
|
|
}
|
|
|
|
|
|
public function testZC()
|