线下扫码支付同步采购金额和销售金额

This commit is contained in:
lewis 2024-02-29 21:53:16 +08:00
parent 58a03e755e
commit 53856b1c4a

View File

@ -233,6 +233,13 @@ class StoreOrderRepository extends BaseRepository
$order->pay_time = $time;
if ($order->source == 999) {
$order->status = 3;
//订单确认收货,增加商户销售金额
Merchant::where('mer_id', $order->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $order->pay_price)]);
//订单确认收货,增加商户采购金额
$merId = Merchant::where('uid', $order->uid)->value('mer_id');
if (!empty($merId)) {
Merchant::where('mer_id', $merId)->update(['purchase_amount' => Db::raw('purchase_amount+' . $order->pay_price)]);
}
}
$svipDiscount = bcadd($order->svip_discount, $svipDiscount, 2);
if (isset($subOrders[$order->order_sn])) {