|
@@ -4,9 +4,11 @@ namespace App\Services;
|
|
|
|
|
|
|
|
use App\Logistic;
|
|
use App\Logistic;
|
|
|
use App\OracleBasCustomer;
|
|
use App\OracleBasCustomer;
|
|
|
|
|
+use App\Shop;
|
|
|
use Carbon\Carbon;
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
+use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
Class LogisticService
|
|
Class LogisticService
|
|
@@ -93,7 +95,7 @@ Class LogisticService
|
|
|
$collect = collect();
|
|
$collect = collect();
|
|
|
if(count($codes) == 0) return $collect;
|
|
if(count($codes) == 0) return $collect;
|
|
|
foreach ($codes as $code) {
|
|
foreach ($codes as $code) {
|
|
|
- $collect->push($this->cacheService->getOrExecute('getLogisticByCodes_'.$code,function()use($code){
|
|
|
|
|
|
|
+ $collect->push(Cache::remember("getLogisticByCodes_{$code}", null, function()use($code){
|
|
|
$logistic = Logistic::query()->where('code',$code)->first();
|
|
$logistic = Logistic::query()->where('code',$code)->first();
|
|
|
if($logistic)return $logistic;
|
|
if($logistic)return $logistic;
|
|
|
$baseCustomers = OracleBasCustomer::query()
|
|
$baseCustomers = OracleBasCustomer::query()
|
|
@@ -101,7 +103,7 @@ Class LogisticService
|
|
|
->where('Customer_Type','CA')
|
|
->where('Customer_Type','CA')
|
|
|
->where('CustomerID',$code)->first();
|
|
->where('CustomerID',$code)->first();
|
|
|
return Logistic::query()->create(['name'=>$baseCustomers['descr_c'],'code'=>$baseCustomers['customerid']]);
|
|
return Logistic::query()->create(['name'=>$baseCustomers['descr_c'],'code'=>$baseCustomers['customerid']]);
|
|
|
- }),config('cache.expirations.forever'));
|
|
|
|
|
|
|
+ }));
|
|
|
}
|
|
}
|
|
|
return $collect;
|
|
return $collect;
|
|
|
}
|
|
}
|