Browse Source

修改运费区域编辑方法不合理处

antshop
linyaostalker 5 years ago
parent
commit
77b08b6a7e
  1. 9
      backend/modules/shop/controllers/ExpressTemplateController.php

9
backend/modules/shop/controllers/ExpressTemplateController.php

@ -253,9 +253,8 @@ class ExpressTemplateController extends Controller
*/ */
public function actionExpressAreaUpdate($id) public function actionExpressAreaUpdate($id)
{ {
$expressTemplateId = Yii::$app->request->get('expressTemplateId');
$expressTemplateModel = ExpressTemplate::findOne($expressTemplateId);
$model = ExpressArea::findOne($id); $model = ExpressArea::findOne($id);
$expressTemplateModel = ExpressTemplate::findOne($model->express_template);
$model->basic_price /= 100; $model->basic_price /= 100;
$model->extra_price /= 100; $model->extra_price /= 100;
if ($expressTemplateModel->calculation_type == ExpressTemplate::CALCULATION_TYPE_WEIGHT) { if ($expressTemplateModel->calculation_type == ExpressTemplate::CALCULATION_TYPE_WEIGHT) {
@ -319,10 +318,10 @@ class ExpressTemplateController extends Controller
*/ */
public function actionExpressAreaView($id) public function actionExpressAreaView($id)
{ {
$expressTemplateId = Yii::$app->request->get('expressTemplateId');
$expressTemplateModel = ExpressTemplate::findOne($expressTemplateId);
$expressAreaModel = ExpressArea::findOne($id);
$expressTemplateModel = ExpressTemplate::findOne($expressAreaModel->express_template);
return $this->render('express_area_view', [ return $this->render('express_area_view', [
'model' => ExpressArea::findOne($id),
'model' => $expressAreaModel,
'expressTemplateModel' => $expressTemplateModel 'expressTemplateModel' => $expressTemplateModel
]); ]);
} }

Loading…
Cancel
Save