|
|
@@ -122,7 +122,7 @@ Class OwnerService
|
|
|
$customerIds = array_diff($customerIds,[null,'','*']);
|
|
|
$owners = Owner::query()->whereIn('code',$customerIds)->get();
|
|
|
|
|
|
- if($owners->count() < count($customerIds)){
|
|
|
+ if($owners->count() < count($customerIds)){
|
|
|
$customerIds = array_diff($customerIds,data_get($owners,'*.code'));
|
|
|
$owner_list = $this->createByWmsCustomerIds($customerIds);
|
|
|
$owners=$owners->concat($owner_list);
|
|
|
@@ -237,4 +237,10 @@ Class OwnerService
|
|
|
return Owner::query()->create(['name'=>$basCustomer['descr_c'],'code'=>$basCustomer['customerid']]);
|
|
|
});
|
|
|
}
|
|
|
+ public function codeGetOwner($code)
|
|
|
+ {
|
|
|
+ return app(CacheService::class)->getOrExecute("owner_".$code,function ()use($code){
|
|
|
+ return Owner::query()->firstOrCreate(["code"=>$code],["code"=>$code,"name"=>$code]);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|