shish 2 月之前
父節點
當前提交
e450b37ace
共有 1 個文件被更改,包括 24 次插入1 次删除
  1. 24 1
      app-ghs/controllers/GhsController.php

+ 24 - 1
app-ghs/controllers/GhsController.php

@@ -35,6 +35,25 @@ class GhsController extends BaseController
         util::complete('修改成功');
     }
 
+    //修改供货商屏蔽/删除状态 ssh 20260527
+    public function actionChangeDelStatus()
+    {
+        $get = Yii::$app->request->get();
+        $ghsId = $get['ghsId'] ?? 0;
+        $delStatus = $get['delStatus'] ?? 0;
+        $ghs = GhsClass::getById($ghsId, true);
+        if (empty($ghs)) {
+            util::fail('没有找到供货商');
+        }
+        $ownMainId = $ghs->ownMainId ?? 0;
+        if ($ownMainId != $this->mainId) {
+            util::fail('不是你的供货商,无法操作');
+        }
+        $ghs->delStatus = $delStatus;
+        $ghs->save();
+        util::complete('操作成功');
+    }
+
     public function actionModifyName()
     {
         $get = Yii::$app->request->get();
@@ -172,7 +191,11 @@ class GhsController extends BaseController
     {
         $get = Yii::$app->request->get();
         $name = isset($get['name']) && !empty($get['name']) ? $get['name'] : '';
-        $where = ['ownShopId' => $this->shopId];
+        $delStatus = isset($get['delStatus']) && is_numeric($get['delStatus']) ? $get['delStatus'] : 0;
+        $where = [
+            'ownShopId' => $this->shopId,
+            'delStatus' => $delStatus
+        ];
         if (!empty($name)) {
             if (stringUtil::isLetter($name)) {
                 $where['py'] = ['like', $name];