调整商户采购金额写入
This commit is contained in:
parent
5abee67569
commit
4b9c717ec6
@ -591,6 +591,11 @@ class MerchantRepository extends BaseRepository
|
|||||||
if ($money > 0) {
|
if ($money > 0) {
|
||||||
//订单确认收货,增加商户销售金额
|
//订单确认收货,增加商户销售金额
|
||||||
Merchant::where('mer_id', $bill->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $money)]);
|
Merchant::where('mer_id', $bill->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $money)]);
|
||||||
|
//订单确认收货,增加商户采购金额
|
||||||
|
$merId = Merchant::where('uid', $bill->uid)->value('mer_id');
|
||||||
|
if (!empty($merId)) {
|
||||||
|
Merchant::where('mer_id', $merId)->update(['purchase_amount' => Db::raw('purchase_amount+' . $money)]);
|
||||||
|
}
|
||||||
app()->make(UserBillRepository::class)->incBill($bill->uid, 'mer_computed_money', 'order', [
|
app()->make(UserBillRepository::class)->incBill($bill->uid, 'mer_computed_money', 'order', [
|
||||||
'link_id' => $order->order_id,
|
'link_id' => $order->order_id,
|
||||||
'mer_id' => $bill->mer_id,
|
'mer_id' => $bill->mer_id,
|
||||||
|
@ -16,7 +16,7 @@ class OrderDeliveryListen implements ListenerInterface
|
|||||||
{
|
{
|
||||||
$order = $event['order'];
|
$order = $event['order'];
|
||||||
foreach ($order->orderProduct as $orderProduct) {
|
foreach ($order->orderProduct as $orderProduct) {
|
||||||
$merchantCate = $orderProduct->product->merCateId;
|
$merchantCate = $orderProduct->product->merCateId->toArray();
|
||||||
if (empty($merchantCate) || $merchantCate[0]['mer_cate_id'] != env('PLATFORM_CARD_CATE_ID')) {
|
if (empty($merchantCate) || $merchantCate[0]['mer_cate_id'] != env('PLATFORM_CARD_CATE_ID')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user