|
|
@@ -139,95 +139,24 @@ class TestController extends Controller
|
|
|
public function zzd(){
|
|
|
ini_set('max_execution_time',2500);
|
|
|
ini_set('memory_limit','1526M');
|
|
|
- $models = WaybillPriceModel::query()->get();
|
|
|
- foreach ($models as $model){
|
|
|
- if ($model->city_name == '汕头/汕尾'){
|
|
|
- $region1 = Region::query()->where("name","汕头")->first();
|
|
|
- $region2 = Region::query()->where("name","汕尾")->first();
|
|
|
- $model->update([
|
|
|
- "province_id" =>$region1->parent_id,
|
|
|
- "city_id" =>$region1->id,
|
|
|
- ]);
|
|
|
- WaybillPriceModel::query()->create([
|
|
|
- 'logistic_id'=> $model->logistic_id,
|
|
|
- 'province_id' => $region2->parent_id,
|
|
|
- 'city_id' => $region2->id,
|
|
|
- 'unit_id' => $model->unit_id,
|
|
|
- 'range_min' => $model->range_min,
|
|
|
- 'range_max'=> $model->range_max,
|
|
|
- 'unit_price'=> $model->unit_price,
|
|
|
- 'base_fee'=> $model->base_fee,
|
|
|
- 'initial_weight'=> $model->initial_weight
|
|
|
- ]);
|
|
|
- LogService::log(__CLASS__,"修改运输计费",$model->toJson());
|
|
|
- continue;
|
|
|
- }
|
|
|
- $obj = [];
|
|
|
- if ($model->province_id){
|
|
|
- $obj["province_id"] = app(RegionService::class)->getProvince($model->province_name);
|
|
|
- }
|
|
|
- if ($model->city_id){
|
|
|
- $obj["city_id"] = app(RegionService::class)->getCity($model->city_name);;
|
|
|
- }
|
|
|
- if (count($obj)>0){
|
|
|
- $model->update($obj);
|
|
|
- LogService::log(__CLASS__,"修改运输计费",$model->toJson());
|
|
|
- }
|
|
|
- }
|
|
|
- dd("OK");
|
|
|
- }
|
|
|
-
|
|
|
- public function zzd1()
|
|
|
- {
|
|
|
- ini_set('max_execution_time',2500);
|
|
|
- ini_set('memory_limit','1526M');
|
|
|
- $models = Waybill::query()->whereNotNull("origination_city_id")
|
|
|
- ->orWhereNotNull("destination_city_id")->get();
|
|
|
- foreach ($models as $model){
|
|
|
- $obj = [];
|
|
|
- if ($model->origination_city_id){
|
|
|
- $city = City::query()->find($model->origination_city_id)->name ?? null;
|
|
|
- if ($city)$obj["origination_city_id"] = app(RegionService::class)->getCity($city);
|
|
|
- }
|
|
|
- if ($model->destination_city_id){
|
|
|
- $city = City::query()->find($model->destination_city_id)->name ?? null;
|
|
|
- if ($city)$obj["destination_city_id"] = app(RegionService::class)->getCity($city);
|
|
|
- }
|
|
|
- if (count($obj)>0){
|
|
|
- $model->update($obj);
|
|
|
- LogService::log(__CLASS__,"修改运输单",$model->toJson());
|
|
|
- }
|
|
|
- }
|
|
|
- dd("OK");
|
|
|
- }
|
|
|
-
|
|
|
- public function zzd2(){
|
|
|
- ini_set('max_execution_time',2500);
|
|
|
- ini_set('memory_limit','1526M');
|
|
|
- $models = DB::select(DB::raw("SELECT * FROM owner_fee_details where logistic_fee is not null and(weight is null or weight <= 0) and type = '发货'"));
|
|
|
- foreach ($models as $model){
|
|
|
- $packages = OrderPackage::query()->with("order")->where("order_id",$model->outer_id)->get();
|
|
|
- $weight = 0;
|
|
|
- $volume = 0;
|
|
|
- foreach ($packages as $package){
|
|
|
- $provinceName = mb_substr($package->order->province,0,2);
|
|
|
- $province = app(CacheService::class)->getOrExecute("province_".$provinceName,function ()use($provinceName){
|
|
|
- return Province::query()->where("name","like",$provinceName."%")->first();
|
|
|
- },86400);
|
|
|
- OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$model->id)
|
|
|
- ->where("logistic_bill",$package->logistic_number)->update([
|
|
|
- "volume" => $package->bulk,
|
|
|
- "weight" => $package->weight,
|
|
|
- "logistic_fee" => app("OwnerPriceExpressService")->matching($package->weight, $model->owner_id, $model->logistic_id, $province->id),
|
|
|
- ]);
|
|
|
- $weight += $package->weight;
|
|
|
- $volume += $package->bulk;
|
|
|
- }
|
|
|
- OwnerFeeDetail::query()->where("id",$model->id)->update([
|
|
|
- "volume" => $volume,
|
|
|
- "weight" => $weight,
|
|
|
- ]);
|
|
|
- }
|
|
|
+ $menus = [
|
|
|
+ "A管理"=>[
|
|
|
+ "A二级"=>[
|
|
|
+ "A三级"
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ "B管理"=>[]
|
|
|
+ ];
|
|
|
+ $authorities = [
|
|
|
+ "A管理"=>[
|
|
|
+ "A二级"=>[
|
|
|
+ "A三级"=>[
|
|
|
+ "A四级"
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ dd($authorities);
|
|
|
}
|
|
|
|
|
|
public function test1(){
|