|
|
@@ -3,9 +3,7 @@
|
|
|
namespace bizGhs\order\classes;
|
|
|
|
|
|
use biz\ghs\classes\GhsClass;
|
|
|
-use biz\shop\services\ShopService;
|
|
|
-use biz\stat\classes\StatOutClass;
|
|
|
-use biz\stat\classes\StatOutMonthClass;
|
|
|
+
|
|
|
use bizGhs\base\classes\BaseClass;
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\order\traits\OrderTrait;
|
|
|
@@ -142,7 +140,7 @@ class PurchaseOrderClass extends BaseClass
|
|
|
ProductClass::changeCost($productId,$avgCost);
|
|
|
|
|
|
}
|
|
|
- self::updateStat($order);
|
|
|
+ self::updateStatByPurchase($order);
|
|
|
$transaction->commit();
|
|
|
return $order;
|
|
|
}catch (\Exception $exception){
|
|
|
@@ -296,17 +294,5 @@ class PurchaseOrderClass extends BaseClass
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- //更新统计
|
|
|
- public static function updateStat($order)
|
|
|
- {
|
|
|
- //记录支出
|
|
|
- //当天
|
|
|
- StatOutClass::updateOrInsert($order['merchantId'],$order['shopId'],$order['orderPrice']);
|
|
|
- //当月
|
|
|
- StatOutMonthClass::updateOrInsert($order['merchantId'],$order['shopId'],$order['orderPrice']);
|
|
|
- //总采购+1
|
|
|
- ShopService::totalPurchaseOrderPlus($order['shopId']);
|
|
|
- //总支出
|
|
|
- ShopService::updateTotalExpend($order['shopId'],$order['orderPrice']);
|
|
|
- }
|
|
|
+
|
|
|
}
|