Browse Source

显示库存管理

shish 3 năm trước cách đây
mục cha
commit
fab20c3bd1
1 tập tin đã thay đổi với 20 bổ sung0 xóa
  1. 20 0
      app-ghs/controllers/CustomController.php

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

@@ -369,6 +369,26 @@ class CustomController extends BaseController
         util::success($info);
     }
 
+    //修改是否显示库存 ssh 20221022
+    public function actionChangeShowStock()
+    {
+        $get = Yii::$app->request->get();
+        $showStock = isset($get['showStock']) ? $get['showStock'] : 0;
+        $customId = isset($get['customId']) ? $get['customId'] : 0;
+        $custom = CustomClass::getById($customId, true);
+        CustomClass::valid($custom, $this->shopId);
+        $ghsId = $custom->ghsId ?? 0;
+        $ghs = GhsClass::getById($ghsId, true);
+        if (empty($ghs)) {
+            util::fail('没有找到供货商');
+        }
+        $ghs->showStock = $showStock;
+        $ghs->save();
+        $custom->showStock = $showStock;
+        $custom->save();
+        util::complete();
+    }
+
     //允许月结开关 ssh 2021.1.8
     public function actionDebt()
     {