Browse Source

修改状态

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

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

@@ -801,6 +801,25 @@ class CustomController extends BaseController
         util::complete();
     }
 
+    public function actionChangeHome()
+    {
+        $get = Yii::$app->request->get();
+        $home = isset($get['home']) ? $get['home'] : 0;
+        $customId = !empty($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->home = $home;
+        $ghs->save();
+        $custom->home = $home;
+        $custom->save();
+        util::complete();
+    }
+
     //允许月结开关 ssh 2021.1.8
     public function actionDebt()
     {