shish 10 ماه پیش
والد
کامیت
690005caa8
1فایلهای تغییر یافته به همراه24 افزوده شده و 0 حذف شده
  1. 24 0
      app-hd/controllers/CustomController.php

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

@@ -675,4 +675,28 @@ class CustomController extends BaseController
         util::success($respond);
     }
 
+    //删除客户 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('删除成功');
+    }
+
 }