shish 4 tahun lalu
induk
melakukan
cd7c2eda4a

+ 1 - 1
app-hd/controllers/GoodsController.php

@@ -40,7 +40,7 @@ class GoodsController extends BaseController
             $staff = $this->shopAdmin ?? [];
             $staffName = $staff->name ?? '';
             $post['staffName'] = $staffName;
-            GoodsClass::cgPlant($post);
+            GoodsClass::cgPlant($post, $this->shop);
             $transaction->commit();
             util::complete();
         } catch (Exception $e) {

+ 2 - 2
biz-hd/goods/classes/GoodsClass.php

@@ -24,7 +24,7 @@ class GoodsClass extends BaseClass
 
     const LOCK_STOCK_GOODS = 'lock_stock_goods_';//修改库存锁
 
-    public static function cgPlant($data)
+    public static function cgPlant($data, $shop)
     {
         //[{"goodsId":"1486","num":"1","price":"2"}]
         $goodsData = $data['goods'] ?? '';
@@ -146,7 +146,7 @@ class GoodsClass extends BaseClass
         $main->totalExpend = $currentExpend;
         $main->save();
         //支出统计
-        StatOutClass::updateOrInsert($main, $orderPrice);
+        StatOutClass::updateOrInsert($main, $shop, $orderPrice);
         //支出流水
         $capitalType = dict::getDict('capitalType', 'hdCgPlant', 'id');
         $event = '采购盆栽绿植等';