Przeglądaj źródła

客户vip切换api

shizhongqi 3 miesięcy temu
rodzic
commit
b1c04879fa
1 zmienionych plików z 20 dodań i 0 usunięć
  1. 20 0
      app-hd/controllers/CustomController.php

+ 20 - 0
app-hd/controllers/CustomController.php

@@ -170,6 +170,26 @@ class CustomController extends BaseController
         util::complete('修改成功');
     }
 
+    //客户vip切换
+    public function actionChangeVip()
+    {
+        $post = Yii::$app->request->post();
+        $vip = $post['vip'];
+        $id = $post['customId'];
+        unset($post['id']);
+        $custom = CustomClass::getById($id, true, 'id, shopId, vip');
+        if (empty($custom)) {
+            util::fail('没有找到客户信息');
+        }
+        if ($custom->shopId != $this->shopId) {
+            util::fial('无权限修改');
+        }
+        $custom->vip = $vip;
+        $custom->save();
+
+        util::complete('修改成功');
+    }
+
     //修改名称 ssh 2022096
     public function actionChangeName()
     {