shizhongqi пре 10 месеци
родитељ
комит
e7b46c84eb
2 измењених фајлова са 37 додато и 0 уклоњено
  1. 24 0
      app-hd/controllers/CustomController.php
  2. 13 0
      app-hd/controllers/GhsController.php

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

@@ -691,4 +691,28 @@ class CustomController extends BaseController
         $list = CustomService::getCustomList($where, $sort);
         util::success($list);
     }
+
+    //删除客户 ssh 20250923
+    public function actionDelCustom()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $custom = CustomClass::getById($id, true);
+        if (empty($custom)) {
+            util::fail('没有找到客户');
+        }
+        if ($custom->shopId != $this->shopId) {
+            util::fail('不是你的客户');
+        }
+        $hdId = $custom->hdId ?? 0;
+        $hd = HdClass::getById($hdId, true);
+        if (empty($hd)) {
+            util::fail('客户信息缺失');
+        }
+        $custom->delStatus = 1;
+        $custom->save();
+        $hd->delStatus = 1;
+        $hd->save();
+        util::complete('删除成功');
+    }
 }

+ 13 - 0
app-hd/controllers/GhsController.php

@@ -130,6 +130,19 @@ class GhsController extends BaseController
     //是否屏蔽 ssh 20230226
     public function actionChangeDelStatus()
     {
+
+        $adminId = $this->adminId;
+        //只有石少华才能删除商家
+        if (getenv('YII_ENV') == 'production') {
+            if ($adminId != 4) {
+                util::fail('开发中');
+            }
+        } else {
+            if ($adminId != 919) {
+                util::fail('开发中');
+            }
+        }
+
         $get = Yii::$app->request->get();
         $ghsId = $get['ghsId'] ?? 0;
         $delStatus = $get['delStatus'] ?? 0;