|
@ -4,6 +4,7 @@ namespace backend\modules\shop\controllers; |
|
|
|
|
|
|
|
|
use backend\modules\shop\logic\ShopManager; |
|
|
use backend\modules\shop\logic\ShopManager; |
|
|
use backend\modules\shop\models\searchs\ExpressAreaSearch; |
|
|
use backend\modules\shop\models\searchs\ExpressAreaSearch; |
|
|
|
|
|
use http\Url; |
|
|
use Throwable; |
|
|
use Throwable; |
|
|
use Yii; |
|
|
use Yii; |
|
|
use backend\modules\shop\models\ars\ExpressTemplate; |
|
|
use backend\modules\shop\models\ars\ExpressTemplate; |
|
@ -205,14 +206,11 @@ class ExpressTemplateController extends Controller |
|
|
$data['status'] = 2; |
|
|
$data['status'] = 2; |
|
|
return $data; |
|
|
return $data; |
|
|
} |
|
|
} |
|
|
if (Yii::$app->request->post('area') == null) { |
|
|
|
|
|
return $this->redirect(Yii::$app->request->referrer . '?status=1'); |
|
|
|
|
|
|
|
|
$area = Yii::$app->request->post('area'); |
|
|
|
|
|
if ($area == null) { |
|
|
|
|
|
return $this->redirect(Yii::$app->request->referrer . '&status=1'); |
|
|
} |
|
|
} |
|
|
$cityIds = array_keys(Yii::$app->request->post('area')); |
|
|
|
|
|
$data['city'] = implode(',', $cityIds); |
|
|
|
|
|
$model->load($data, ''); |
|
|
|
|
|
ShopManager::expressAreaScaleDate($model, $expressTemplateModel); //按比例转换数据
|
|
|
|
|
|
$model->save(); |
|
|
|
|
|
|
|
|
ShopManager::dealAreaInExpressArea($area, $model, $expressTemplateModel); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -247,14 +245,11 @@ class ExpressTemplateController extends Controller |
|
|
|
|
|
|
|
|
$data = Yii::$app->request->post('ExpressArea'); |
|
|
$data = Yii::$app->request->post('ExpressArea'); |
|
|
if ($data) { |
|
|
if ($data) { |
|
|
if (Yii::$app->request->post('area') == null) { |
|
|
|
|
|
|
|
|
$area = Yii::$app->request->post('area'); |
|
|
|
|
|
if ($area == null) { |
|
|
return $this->redirect(Yii::$app->request->referrer . '&status=1'); |
|
|
return $this->redirect(Yii::$app->request->referrer . '&status=1'); |
|
|
} |
|
|
} |
|
|
$cityIds = array_keys(Yii::$app->request->post('area')); |
|
|
|
|
|
$data['city'] = implode(',', $cityIds); |
|
|
|
|
|
$model->load($data, ''); |
|
|
|
|
|
ShopManager::expressAreaScaleDate($model, $expressTemplateModel); //按比例转换数据
|
|
|
|
|
|
$model->save(); |
|
|
|
|
|
|
|
|
ShopManager::dealAreaInExpressArea($area, $model, $expressTemplateModel); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
return $this->redirect('express-area-list?id='.$model->express_template); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|