|
|
@@ -158,9 +158,16 @@ class TestController extends Controller
|
|
|
dd(Region::query()->where("id",">=",404)->where("id","<=",432)->delete());
|
|
|
}
|
|
|
public function tt1(){
|
|
|
- $a = new Owner();
|
|
|
- $a->load("ownerPriceOperations");
|
|
|
- dd($a);
|
|
|
+ $owner = Owner::query()->withCount(["ownerStoragePriceModels","ownerPriceOperations","ownerPriceExpresses","ownerPriceLogistics","ownerPriceDirectLogistics"])->get();
|
|
|
+ foreach ($owner as $o){
|
|
|
+ $arr = [];
|
|
|
+ if ($o->owner_storage_price_models_count)$arr[] = 0;
|
|
|
+ if ($o->owner_price_operations_count)$arr[] = 1;
|
|
|
+ if ($o->owner_price_expresses_count)$arr[] = 2;
|
|
|
+ if ($o->owner_price_logistics_count)$arr[] = 3;
|
|
|
+ if ($o->owner_price_direct_logistics_count)$arr[] = 4;
|
|
|
+ $o->update(["relevance"=>json_encode($arr)]);
|
|
|
+ }
|
|
|
}
|
|
|
public function zzd(){
|
|
|
ini_set('max_execution_time',2500);
|