|
@@ -83,7 +83,9 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
]);
|
|
|
$model = new OwnerStoragePriceModel();
|
|
$model = new OwnerStoragePriceModel();
|
|
|
$model->id = $request->input("id");
|
|
$model->id = $request->input("id");
|
|
|
- $model->owners()->sync(explode(",",$request->input("owner_id")));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync(explode(",",$request->input("owner_id")));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],0);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],0,true);
|
|
|
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',"更新成功!");
|
|
|
}
|
|
}
|
|
@@ -293,7 +295,11 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
//录入中间表
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $ownerPriceOperation */
|
|
/** @var OwnerPriceOperation $ownerPriceOperation */
|
|
|
- if ($request->input("owner_id"))$ownerPriceOperation->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ if ($request->input("owner_id")){
|
|
|
|
|
+ $result = $ownerPriceOperation->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],1);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],1,true);
|
|
|
|
|
+ }
|
|
|
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")."”成功");
|
|
|
}
|
|
}
|
|
@@ -347,7 +353,11 @@ class PriceModelController extends Controller
|
|
|
}
|
|
}
|
|
|
//录入中间表
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $model */
|
|
/** @var OwnerPriceOperation $model */
|
|
|
- if ($request->input("owner_id"))$model->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ if ($request->input("owner_id")){
|
|
|
|
|
+ $result = $model->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],1);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],1,true);
|
|
|
|
|
+ }
|
|
|
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")."”成功");
|
|
|
}
|
|
}
|
|
@@ -480,7 +490,9 @@ 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"),
|
|
|
]);
|
|
]);
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],2);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],2,true);
|
|
|
$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")."”成功");
|
|
@@ -510,7 +522,9 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
]);
|
|
|
$model = new OwnerPriceExpress();
|
|
$model = new OwnerPriceExpress();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],2);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],2,true);
|
|
|
$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")."”成功");
|
|
@@ -588,7 +602,9 @@ 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"),
|
|
|
]);
|
|
]);
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],3);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],3,true);
|
|
|
$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")."”成功");
|
|
@@ -622,7 +638,9 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
]);
|
|
|
$model = new OwnerPriceLogistic();
|
|
$model = new OwnerPriceLogistic();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],3);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],3,true);
|
|
|
$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")."”成功");
|
|
@@ -876,7 +894,9 @@ class PriceModelController extends Controller
|
|
|
"name" => $request->input("name"),
|
|
"name" => $request->input("name"),
|
|
|
"base_km" => $request->input("base_km"),
|
|
"base_km" => $request->input("base_km"),
|
|
|
]);
|
|
]);
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],4);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],4,true);
|
|
|
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")."”成功");
|
|
|
}
|
|
}
|
|
@@ -911,7 +931,9 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
]);
|
|
|
$model = new OwnerPriceDirectLogistic();
|
|
$model = new OwnerPriceDirectLogistic();
|
|
|
$model->id = $id;
|
|
$model->id = $id;
|
|
|
- $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
|
|
+ $result = $model->owners()->sync($request->input("owner_id"));
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["attached"],4);
|
|
|
|
|
+ app("OwnerService")->refreshRelevance($result["detached"],4,true);
|
|
|
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")."”成功");
|
|
|
}
|
|
}
|