Jelajahi Sumber

支出统计

shish 5 tahun lalu
induk
melakukan
3e39c6bd6b

+ 3 - 3
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -153,9 +153,6 @@ class PurchaseOrderClass extends BaseClass
 
             }
 
-            //当天和当月支出统计
-            StatOutClass::updateOrInsert($order['sjId'], $order['shopId'], $order['orderPrice']);
-
             //门店支出增加
             $shop = ShopClass::getLockById($shopId);
             if (empty($shop)) {
@@ -166,6 +163,9 @@ class PurchaseOrderClass extends BaseClass
             $shop->totalExpend = $currentTotalExpend;
             $shop->save();
 
+            //当天和当月支出统计
+            StatOutClass::updateOrInsert($shop, $order['orderPrice']);
+
             //支出流水
             $payWay = dict::getDict('payWay', 'unknown');
             $capitalType = dict::getDict('capitalType', 'ghsPurchase', 'id');

+ 1 - 1
biz-hd/purchase/services/PurchaseService.php

@@ -250,7 +250,7 @@ class PurchaseService extends BaseService
         $shop->save();
 
         //当天和当月支出统计
-        StatOutClass::updateOrInsert($info->sjId, $info->shopId, $info->actPrice);
+        StatOutClass::updateOrInsert($shop, $info->actPrice);
 
         //使用优惠券
         $couponId = $info->couponId;