Selaa lähdekoodia

修改平均库存

shish 9 kuukautta sitten
vanhempi
commit
8fe968ecde
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 18 0
      app-ghs/controllers/ProductController.php

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

@@ -36,6 +36,24 @@ class ProductController extends BaseController
 
     public $guestAccess = ['index'];
 
+    //修改平均成本 ssh 2025114
+    public function actionModifyAvCost()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $amount = $get['amount'] ?? 0;
+        $product = ProductClass::getById($id, true);
+        if (empty($info)) {
+            util::fail('没有找到花材');
+        }
+        if ($product->mainId != $this->mainId) {
+            util::fail('不是你的花材');
+        }
+        $product->avCost = $amount;
+        $product->save();
+        util::complete('修改成功');
+    }
+
     //修改路上库存 ssh 20231219
     public function actionModifyOnStock()
     {