|
|
@@ -3,6 +3,8 @@
|
|
|
namespace App\Imports;
|
|
|
|
|
|
use App\Commodity;
|
|
|
+use App\OracleBasSKU;
|
|
|
+use App\Owner;
|
|
|
use App\Services\InventoryCompareService;
|
|
|
use Illuminate\Support\Collection;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
@@ -75,6 +77,10 @@ class InventoryCompareImport implements ToCollection, WithHeadingRow, WithMultip
|
|
|
continue;
|
|
|
}
|
|
|
$hasSku=Commodity::where('owner_id',$this->owner_id)->where('sku',$row[$skuName])->first();
|
|
|
+ if(!$hasSku) {
|
|
|
+ $owner=Owner::find($this->owner_id);
|
|
|
+ $hasSku = OracleBasSKU::query()->where('sku', $row[$skuName])->where('customerid', $owner->code)->first();
|
|
|
+ }
|
|
|
if (!$hasSku){
|
|
|
array_push($exception, ['该货主下不存在产品编号:'.$row[$skuName]]);
|
|
|
$sum++;
|