shish 1 anno fa
parent
commit
fa28ceba3e
1 ha cambiato i file con 24 aggiunte e 0 eliminazioni
  1. 24 0
      app-ghs/controllers/ItemController.php

+ 24 - 0
app-ghs/controllers/ItemController.php

@@ -21,6 +21,30 @@ use Yii;
 class ItemController extends BaseController
 {
 
+    //挪到处理区 ssh 20250418
+    public function actionMoveToLosing()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? '';
+        $num = $get['num'] ?? 0;
+        $item = ItemClass::getById($id, true);
+        if (empty($item)) {
+            util::fail('没有找到花材');
+        }
+        if ($item->mainId != $this->mainId) {
+            util::fail('不是你的花材');
+        }
+        if ($num <= 0) {
+            util::fail('请输入数量');
+        }
+        $stock = $item->stock ?? 0;
+        $stock = floatval($stock);
+        if ($num > $stock) {
+            util::fail('剩' . $stock . '可以挪动');
+        }
+        util::complete('挪动成功');
+    }
+
     //设为处理区用的花材 ssh 20250418
     public function actionSetLosing()
     {