|
|
@@ -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()
|
|
|
{
|