|
|
@@ -124,29 +124,22 @@ class ShopController extends BaseController
|
|
|
//更新门店 ssh 2020.2.29
|
|
|
public function actionUpdate()
|
|
|
{
|
|
|
- $data = Yii::$app->request->post();
|
|
|
-
|
|
|
- $shop = $this->shop;
|
|
|
- if (isset($shop->default) == false || $shop->default != 1) {
|
|
|
- util::fail('当前直营分店,请切回总店修改');
|
|
|
- }
|
|
|
-
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
$shopAdmin = $this->shopAdmin;
|
|
|
if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
util::fail('超管才能修改');
|
|
|
}
|
|
|
-
|
|
|
- $data['sjId'] = $this->sjId;
|
|
|
- $id = $data['id'] ?? 0;
|
|
|
+ $post['sjId'] = $this->sjId;
|
|
|
+ $id = $post['id'] ?? 0;
|
|
|
$shop = ShopService::getById($id);
|
|
|
if (empty($shop)) {
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
ShopClass::valid($shop, $this->sjId);
|
|
|
//手机号具有唯一性,暂时不允许修改
|
|
|
- unset($data['mobile']);
|
|
|
- $data['img'] = isset($data['img']) && is_array($data['img']) ? json_encode($data['img']) : '';
|
|
|
- \biz\shop\classes\ShopClass::updateShop($shop, $data);
|
|
|
+ unset($post['mobile']);
|
|
|
+ $post['img'] = isset($post['img']) && is_array($post['img']) ? json_encode($post['img']) : '';
|
|
|
+ \biz\shop\classes\ShopClass::updateShop($shop, $post);
|
|
|
util::complete();
|
|
|
}
|
|
|
|