shish 2 лет назад
Родитель
Сommit
bb65678d05
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      app-ghs/controllers/CustomController.php

+ 11 - 0
app-ghs/controllers/CustomController.php

@@ -27,6 +27,17 @@ class CustomController extends BaseController
     //修改客户地址 ssh 20230929
     public function actionModifyAddress()
     {
+        $post = Yii::$app->request->post();
+        $id = $post['id'] ?? 0;
+        unset($post['id']);
+        $custom = CustomClass::getById($id, true);
+        if ($custom->ownMainId != $this->mainId) {
+            util::fail('没有权限修改');
+        }
+        $shopId = $custom->shopId ?? 0;
+        $where = ['shopId' => $shopId];
+        ShopClass::updateById($shopId, $post);
+        CustomClass::updateByCondition($where, $post);
         util::complete('修改成功');
     }