Jelajahi Sumber

修改供货商类型

shish 2 tahun lalu
induk
melakukan
2b1e552b79
1 mengubah file dengan 18 tambahan dan 0 penghapusan
  1. 18 0
      app-ghs/controllers/GhsController.php

+ 18 - 0
app-ghs/controllers/GhsController.php

@@ -17,6 +17,24 @@ use bizGhs\order\classes\PurchaseOrderClass;
 class GhsController extends BaseController
 {
 
+    //修改供货商类型 ssh 20240727
+    public function actionChangeLocation()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $ghs = GhsClass::getById($id, true);
+        if (empty($ghs)) {
+            util::fail('没有找到供货商');
+        }
+        if ($ghs->ownMainId != $this->mainId) {
+            util::fail('不是你的供货商');
+        }
+        $newLocation = $ghs->location == 0 ? 1 :0;
+        $ghs->location = $newLocation;
+        $ghs->save();
+        util::complete('修改成功');
+    }
+
     public function actionModifyName()
     {
         $get = Yii::$app->request->get();