|
@ -332,6 +332,15 @@ class ExpressTemplateController extends Controller |
|
|
$cityIds = array_keys(Yii::$app->request->post('area')); |
|
|
$cityIds = array_keys(Yii::$app->request->post('area')); |
|
|
$data['city'] = implode(',', $cityIds); |
|
|
$data['city'] = implode(',', $cityIds); |
|
|
$model->load($data, ''); |
|
|
$model->load($data, ''); |
|
|
|
|
|
$model->basic_price *= 100; |
|
|
|
|
|
$model->extra_price *= 100; |
|
|
|
|
|
if ($expressTemplateModel->calculation_type == ExpressTemplate::CALCULATION_TYPE_WEIGHT) { |
|
|
|
|
|
$model->basic_count *= 10; |
|
|
|
|
|
$model->extra_count *= 10; |
|
|
|
|
|
} else { |
|
|
|
|
|
$model->basic_count *= 1; |
|
|
|
|
|
$model->extra_count *= 1; |
|
|
|
|
|
} |
|
|
$model->save(); |
|
|
$model->save(); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
} |
|
|
} |
|
@ -364,4 +373,19 @@ class ExpressTemplateController extends Controller |
|
|
'model' => $model, 'data' => $data, 'cities' => explode(',', $model->city), 'expressTemplateModel' => $expressTemplateModel |
|
|
'model' => $model, 'data' => $data, 'cities' => explode(',', $model->city), 'expressTemplateModel' => $expressTemplateModel |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param $id |
|
|
|
|
|
* @return string |
|
|
|
|
|
* 运费区域模板区域查看方法 |
|
|
|
|
|
*/ |
|
|
|
|
|
public function actionExpressAreaView($id) |
|
|
|
|
|
{ |
|
|
|
|
|
$expressTemplateId = Yii::$app->request->get('expressTemplateId'); |
|
|
|
|
|
$expressTemplateModel = ExpressTemplate::findOne($expressTemplateId); |
|
|
|
|
|
return $this->render('express_area_view', [ |
|
|
|
|
|
'model' => ExpressArea::findOne($id), |
|
|
|
|
|
'expressTemplateModel' => $expressTemplateModel |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |