|
|
@@ -240,19 +240,4 @@ Class OwnerService
|
|
|
return Owner::query()->firstOrCreate(["code"=>$code],["code"=>$code,"name"=>$code]);
|
|
|
});
|
|
|
}
|
|
|
- public function getOwnerByCodes($codes)
|
|
|
- {
|
|
|
- $collect = collect();
|
|
|
- if(count($codes) == 0)return $collect;
|
|
|
- foreach ($codes as $code) {
|
|
|
- $collect->push(Cache::remember("getOwnerByCodes_{$code}", config('database.cache.expirations.rand'), function ()use($code){
|
|
|
- $owner = Owner::query()->where('code',$code)->first();
|
|
|
- if($owner) return $owner;
|
|
|
- $basCustomer = OracleBasCustomer::query()->where('Customer_Type','OW')->where('CustomerID', $code)->first();
|
|
|
- if(!$basCustomer)return null;
|
|
|
- return Owner::query()->create(['name'=>$basCustomer['descr_c'],'code'=>$basCustomer['customerid']]);
|
|
|
- }));
|
|
|
- }
|
|
|
- return $collect;
|
|
|
- }
|
|
|
}
|