|
@@ -18,7 +18,6 @@ use App\OwnerPriceOperationItem;
|
|
|
use App\OwnerPriceSystem;
|
|
use App\OwnerPriceSystem;
|
|
|
use App\OwnerStoragePriceModel;
|
|
use App\OwnerStoragePriceModel;
|
|
|
use App\Services\common\BatchUpdateService;
|
|
use App\Services\common\BatchUpdateService;
|
|
|
-use App\Services\common\ExportService;
|
|
|
|
|
use App\Services\common\QueryService;
|
|
use App\Services\common\QueryService;
|
|
|
use App\Services\LogService;
|
|
use App\Services\LogService;
|
|
|
use App\Services\OwnerPriceOperationItemService;
|
|
use App\Services\OwnerPriceOperationItemService;
|
|
@@ -30,6 +29,7 @@ use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
|
|
|
+use Oursdreams\Export\Export;
|
|
|
|
|
|
|
|
class PriceModelController extends Controller
|
|
class PriceModelController extends Controller
|
|
|
{
|
|
{
|
|
@@ -55,8 +55,7 @@ class PriceModelController extends Controller
|
|
|
$this->storageValidator($request->input())->validate();
|
|
$this->storageValidator($request->input())->validate();
|
|
|
/** @var OwnerStoragePriceModel $model */
|
|
/** @var OwnerStoragePriceModel $model */
|
|
|
$model = app('OwnerStoragePriceModelService')->create($request->input());
|
|
$model = app('OwnerStoragePriceModelService')->create($request->input());
|
|
|
- $result = $model->owners()->sync(explode(",",$request->input("owner_id")));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],0);
|
|
|
|
|
|
|
+ $model->owners()->sync(explode(",",$request->input("owner_id")));
|
|
|
LogService::log(__METHOD__,"计费模型-创建仓储计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-创建仓储计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"创建成功!");
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"创建成功!");
|
|
|
}
|
|
}
|
|
@@ -92,9 +91,7 @@ class PriceModelController extends Controller
|
|
|
$service->update(["id"=>$id],$values);
|
|
$service->update(["id"=>$id],$values);
|
|
|
$model = new OwnerStoragePriceModel();
|
|
$model = new OwnerStoragePriceModel();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $result = $model->owners()->sync(explode(",",request("owner_id")));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],0);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],0,true);
|
|
|
|
|
|
|
+ $model->owners()->sync(explode(",",request("owner_id")));
|
|
|
}else $service->copy($model,$values,explode(",",request("owner_id")));
|
|
}else $service->copy($model,$values,explode(",",request("owner_id")));
|
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"更新成功!");
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"更新成功!");
|
|
|
}
|
|
}
|
|
@@ -321,11 +318,7 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
//录入中间表
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $ownerPriceOperation */
|
|
/** @var OwnerPriceOperation $ownerPriceOperation */
|
|
|
- if ($request->input("owner_id")){
|
|
|
|
|
- $result = $ownerPriceOperation->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],1);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],1,true);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if ($request->input("owner_id"))$ownerPriceOperation->owners()->sync($request->input("owner_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-录入作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-录入作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","创建“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","创建“".$request->input("name")."”成功");
|
|
|
}
|
|
}
|
|
@@ -381,11 +374,7 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
//录入中间表
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $model */
|
|
/** @var OwnerPriceOperation $model */
|
|
|
- if ($request->input("owner_id")){
|
|
|
|
|
- $result = $model->owners()->sync(request("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],1);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],1,true);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if ($request->input("owner_id"))$model->owners()->sync(request("owner_id"));
|
|
|
}else $service->copy($model,$obj,request("owner_id"),request("items"),false);
|
|
}else $service->copy($model,$obj,request("owner_id"),request("items"),false);
|
|
|
LogService::log(__METHOD__,"计费模型-修改作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-修改作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","修改“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","修改“".$request->input("name")."”成功");
|
|
@@ -516,9 +505,7 @@ class PriceModelController extends Controller
|
|
|
"initial_weight" => $request->input("initial_weight"),
|
|
"initial_weight" => $request->input("initial_weight"),
|
|
|
"additional_weight" => $request->input("additional_weight"),
|
|
"additional_weight" => $request->input("additional_weight"),
|
|
|
]);
|
|
]);
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],2);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],2,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-录入快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-录入快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/express")->with("successTip","录入“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/express")->with("successTip","录入“".$request->input("name")."”成功");
|
|
@@ -550,9 +537,7 @@ class PriceModelController extends Controller
|
|
|
app("OwnerPriceExpressService")->update(["id"=>$id],$values);
|
|
app("OwnerPriceExpressService")->update(["id"=>$id],$values);
|
|
|
$model = new OwnerPriceExpress();
|
|
$model = new OwnerPriceExpress();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],2);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],2,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
}else app("OwnerPriceExpressService")->copy($model,$values,$request->input("owner_id"),$request->input("logistic_id"));
|
|
}else app("OwnerPriceExpressService")->copy($model,$values,$request->input("owner_id"),$request->input("logistic_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-修改快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-修改快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
@@ -637,9 +622,7 @@ class PriceModelController extends Controller
|
|
|
"other_unit_id" => $request->input("other_unit_id"),
|
|
"other_unit_id" => $request->input("other_unit_id"),
|
|
|
"other_unit_range" => $request->input("other_unit_range"),
|
|
"other_unit_range" => $request->input("other_unit_range"),
|
|
|
]);
|
|
]);
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],3);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],3,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-录入物流计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-录入物流计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/logistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/logistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
@@ -675,9 +658,7 @@ class PriceModelController extends Controller
|
|
|
app("OwnerPriceLogisticService")->update(["id"=>$id],$values);
|
|
app("OwnerPriceLogisticService")->update(["id"=>$id],$values);
|
|
|
$model = new OwnerPriceLogistic();
|
|
$model = new OwnerPriceLogistic();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],3);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],3,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
}else app("OwnerPriceLogisticService")->copy($model,$values,$request->input("owner_id"),$request->input("logistic_id"));
|
|
}else app("OwnerPriceLogisticService")->copy($model,$values,$request->input("owner_id"),$request->input("logistic_id"));
|
|
|
|
|
|
|
@@ -722,7 +703,7 @@ class PriceModelController extends Controller
|
|
|
$detail->additional_weight_price,
|
|
$detail->additional_weight_price,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
- return app(ExportService::class)->json($row,$list,"快递计费模型");
|
|
|
|
|
|
|
+ return Export::make($row,$list,"快递计费模型");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function logisticImport(Request $request)
|
|
public function logisticImport(Request $request)
|
|
@@ -794,7 +775,7 @@ class PriceModelController extends Controller
|
|
|
$detail->rate ? $detail->rate."%" : '',
|
|
$detail->rate ? $detail->rate."%" : '',
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
- return app(ExportService::class)->json($row,$list,"物流计费模型");
|
|
|
|
|
|
|
+ return Export::make($row,$list,"物流计费模型");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function logisticUpdateDetail(Request $request)
|
|
public function logisticUpdateDetail(Request $request)
|
|
@@ -954,9 +935,7 @@ class PriceModelController extends Controller
|
|
|
"name" => $request->input("name"),
|
|
"name" => $request->input("name"),
|
|
|
"base_km" => $request->input("base_km"),
|
|
"base_km" => $request->input("base_km"),
|
|
|
]);
|
|
]);
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],4);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],4,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-录入直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-录入直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
|
}
|
|
}
|
|
@@ -995,9 +974,7 @@ class PriceModelController extends Controller
|
|
|
app("OwnerPriceDirectLogisticService")->update(["id"=>$id],$values);
|
|
app("OwnerPriceDirectLogisticService")->update(["id"=>$id],$values);
|
|
|
$model = new OwnerPriceDirectLogistic();
|
|
$model = new OwnerPriceDirectLogistic();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["attached"],4);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($result["detached"],4,true);
|
|
|
|
|
|
|
+ $model->owners()->sync($request->input("owner_id"));
|
|
|
}else app("OwnerPriceDirectLogisticService")->copy($model,$values,request("owner_id"));
|
|
}else app("OwnerPriceDirectLogisticService")->copy($model,$values,request("owner_id"));
|
|
|
LogService::log(__METHOD__,"计费模型-修改直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
LogService::log(__METHOD__,"计费模型-修改直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","修改“".$request->input("name")."”成功");
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","修改“".$request->input("name")."”成功");
|
|
@@ -1119,7 +1096,7 @@ class PriceModelController extends Controller
|
|
|
|
|
|
|
|
public function apiStoreStorage()
|
|
public function apiStoreStorage()
|
|
|
{
|
|
{
|
|
|
- $this->gate("项目管理-仓储-录入");
|
|
|
|
|
|
|
+ $this->gate("计费模型-仓储-录入");
|
|
|
$errors = $this->storageValidator(request()->input())->errors();
|
|
$errors = $this->storageValidator(request()->input())->errors();
|
|
|
if (count($errors)>0)$this->success(["errors"=>$errors]);
|
|
if (count($errors)>0)$this->success(["errors"=>$errors]);
|
|
|
|
|
|
|
@@ -1146,7 +1123,6 @@ class PriceModelController extends Controller
|
|
|
}else{
|
|
}else{
|
|
|
$model = app('OwnerStoragePriceModelService')->create($values);
|
|
$model = app('OwnerStoragePriceModelService')->create($values);
|
|
|
DB::insert(DB::raw("INSERT INTO owner_storage_price_model_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
DB::insert(DB::raw("INSERT INTO owner_storage_price_model_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
|
- app("OwnerService")->refreshRelevance(request("owner_id"),0);
|
|
|
|
|
$this->success($model->id);
|
|
$this->success($model->id);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1225,7 +1201,6 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
app("OwnerPriceOperationItemService")->insert($params["items"]);
|
|
app("OwnerPriceOperationItemService")->insert($params["items"]);
|
|
|
DB::insert(DB::raw("INSERT INTO owner_price_operation_owner(owner_price_operation_id,owner_id) VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
DB::insert(DB::raw("INSERT INTO owner_price_operation_owner(owner_price_operation_id,owner_id) VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
|
- app("OwnerService")->refreshRelevance(request("owner_id"),1);
|
|
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -1300,7 +1275,6 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
OwnerPriceExpressProvince::query()->insert($params["items"]);
|
|
OwnerPriceExpressProvince::query()->insert($params["items"]);
|
|
|
DB::insert(DB::raw("INSERT INTO owner_price_express_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
DB::insert(DB::raw("INSERT INTO owner_price_express_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
|
- app("OwnerService")->refreshRelevance(request("owner_id"),2);
|
|
|
|
|
/** @var OwnerPriceExpress $model */
|
|
/** @var OwnerPriceExpress $model */
|
|
|
$model->logistics()->syncWithoutDetaching(request("logistics"));
|
|
$model->logistics()->syncWithoutDetaching(request("logistics"));
|
|
|
DB::commit();
|
|
DB::commit();
|
|
@@ -1382,7 +1356,6 @@ class PriceModelController extends Controller
|
|
|
foreach ($params["items"] as &$param)$param["owner_price_logistic_id"] = $model->id;
|
|
foreach ($params["items"] as &$param)$param["owner_price_logistic_id"] = $model->id;
|
|
|
OwnerPriceLogisticDetail::query()->insert($params["items"]);
|
|
OwnerPriceLogisticDetail::query()->insert($params["items"]);
|
|
|
DB::insert(DB::raw("INSERT INTO owner_price_logistic_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
DB::insert(DB::raw("INSERT INTO owner_price_logistic_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
|
- app("OwnerService")->refreshRelevance(request("owner_id"),3);
|
|
|
|
|
/** @var OwnerPriceLogistic $model */
|
|
/** @var OwnerPriceLogistic $model */
|
|
|
$model->logistics()->syncWithoutDetaching(request("logistics"));
|
|
$model->logistics()->syncWithoutDetaching(request("logistics"));
|
|
|
DB::commit();
|
|
DB::commit();
|
|
@@ -1447,7 +1420,6 @@ class PriceModelController extends Controller
|
|
|
foreach ($items as &$item)$item["owner_price_direct_logistic_id"] = $model->id;
|
|
foreach ($items as &$item)$item["owner_price_direct_logistic_id"] = $model->id;
|
|
|
OwnerPriceDirectLogisticCar::query()->insert($items);
|
|
OwnerPriceDirectLogisticCar::query()->insert($items);
|
|
|
DB::insert(DB::raw("INSERT INTO owner_price_direct_logistic_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
DB::insert(DB::raw("INSERT INTO owner_price_direct_logistic_owner VALUES(?,?)"),[$model->id,request("owner_id")]);
|
|
|
- app("OwnerService")->refreshRelevance(request("owner_id"),4);
|
|
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -1807,11 +1779,12 @@ class PriceModelController extends Controller
|
|
|
/** @var \stdClass|Owner $owner */
|
|
/** @var \stdClass|Owner $owner */
|
|
|
$owner = new Owner();
|
|
$owner = new Owner();
|
|
|
$owner->id = $ownerId;
|
|
$owner->id = $ownerId;
|
|
|
|
|
+ $response = null;
|
|
|
switch (request("type")){
|
|
switch (request("type")){
|
|
|
case "storage":
|
|
case "storage":
|
|
|
app("OwnerStoragePriceModelService")->auditOrRecover(request("isAudit"),$ownerId);//priceModelAuditOrRecoverQuery
|
|
app("OwnerStoragePriceModelService")->auditOrRecover(request("isAudit"),$ownerId);//priceModelAuditOrRecoverQuery
|
|
|
$owner->load("ownerStoragePriceModels");
|
|
$owner->load("ownerStoragePriceModels");
|
|
|
- $this->success($owner->ownerStoragePriceModels);
|
|
|
|
|
|
|
+ $response = $owner->ownerStoragePriceModels;
|
|
|
break;
|
|
break;
|
|
|
case "operation":
|
|
case "operation":
|
|
|
app("OwnerPriceOperationService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
app("OwnerPriceOperationService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
@@ -1834,7 +1807,7 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- $this->success($owner->ownerPriceOperations);
|
|
|
|
|
|
|
+ $response = $owner->ownerPriceOperations;
|
|
|
break;
|
|
break;
|
|
|
case "express":
|
|
case "express":
|
|
|
app("OwnerPriceExpressService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
app("OwnerPriceExpressService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
@@ -1842,7 +1815,7 @@ class PriceModelController extends Controller
|
|
|
/** @var Builder $query */
|
|
/** @var Builder $query */
|
|
|
$query->with(["details","logistics"]);
|
|
$query->with(["details","logistics"]);
|
|
|
}]);
|
|
}]);
|
|
|
- $this->success($owner->ownerPriceExpresses);
|
|
|
|
|
|
|
+ $response = $owner->ownerPriceExpresses;
|
|
|
break;
|
|
break;
|
|
|
case "logistic":
|
|
case "logistic":
|
|
|
app("OwnerPriceLogisticService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
app("OwnerPriceLogisticService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
@@ -1850,7 +1823,7 @@ class PriceModelController extends Controller
|
|
|
/** @var Builder $query */
|
|
/** @var Builder $query */
|
|
|
$query->with(["details","logistics"]);
|
|
$query->with(["details","logistics"]);
|
|
|
}]);
|
|
}]);
|
|
|
- $this->success($owner->ownerPriceLogistics);
|
|
|
|
|
|
|
+ $response = $owner->ownerPriceLogistics;
|
|
|
break;
|
|
break;
|
|
|
case "directLogistic":
|
|
case "directLogistic":
|
|
|
app("OwnerPriceDirectLogisticService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
app("OwnerPriceDirectLogisticService")->auditOrRecover(request("isAudit"),$ownerId);
|
|
@@ -1859,18 +1832,14 @@ class PriceModelController extends Controller
|
|
|
break;
|
|
break;
|
|
|
case "system":
|
|
case "system":
|
|
|
$result = app(QueryService::class)->priceModelAuditOrRecoverQuery(request("isAudit"),OwnerPriceSystem::query(),$ownerId,null,true);
|
|
$result = app(QueryService::class)->priceModelAuditOrRecoverQuery(request("isAudit"),OwnerPriceSystem::query(),$ownerId,null,true);
|
|
|
- if ($result["delete"]){
|
|
|
|
|
- OwnerPriceSystem::destroy($result["delete"]);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($ownerId,5,true);
|
|
|
|
|
- }
|
|
|
|
|
- if ($result["update"]){
|
|
|
|
|
- OwnerPriceSystem::query()->whereIn("id",$result["update"])->update(["operation"=>null,"target_id"=>null]);
|
|
|
|
|
- app("OwnerService")->refreshRelevance($ownerId,5);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if ($result["delete"])OwnerPriceSystem::destroy($result["delete"]);
|
|
|
|
|
+ if ($result["update"])OwnerPriceSystem::query()->whereIn("id",$result["update"])->update(["operation"=>null,"target_id"=>null]);
|
|
|
$owner->load("ownerPriceSystem");
|
|
$owner->load("ownerPriceSystem");
|
|
|
- $this->success($owner->ownerPriceSystem);
|
|
|
|
|
|
|
+ $response = $owner->ownerPriceSystem;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($ownerId);
|
|
|
|
|
+ $this->success($response);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|