CRMEB多商户B2B2C商城系统v2.0.3版本修复退款后优惠券没有正确返还解决方案

管理 管理 编辑 删除

1. 打开`\app\common\repositories\store\order\StoreOrderRepository.php`文件,在1941行找到`orderRefundAllAfter`方法

2. 将方法内容替换为一下内容

    public function orderRefundAllAfter($order)
    {
        $statusRepository = app()->make(StoreOrderStatusRepository::class);
        $statusRepository->status($order['order_id'], $statusRepository::ORDER_STATUS_REFUND_ALL, '订单已全部退款');
        if ($order->activity_type == 10) {
            app()->make(StoreDiscountRepository::class)->incStock($order->orderProduct[0]['activity_id']);
        }
        $mainId = $order->main_id ?: $order->order_id;
        $count = $this->query([])->where('status', '<>', -1)->where(function ($query) use ($mainId) {
            $query->where('order_id', $mainId)->whereOr('main_id', $mainId);
        })->count();
        //拆单后完全退完
        if (!$count) {
            if ($order->main_id) {
                $order = $this->query(['order_id' => $mainId])->find();
            }
            $couponId = [];
            if ($order->coupon_id) {
                $couponId = explode(',', $order->coupon_id);
            }
            app()->make(MerchantRepository::class)->computedLockMoney($order);
            //总单所有订单全部退完
            if (!$this->query([])->where('status', '<>', -1)->where('group_order_id', $order->group_order_id)->count()) {
                if ($order->groupOrder->coupon_id) {
                    $couponId[] = $order->groupOrder->coupon_id;
                }
            }
            if (count($couponId)) {
                app()->make(StoreCouponUserRepository::class)->updates($couponId, ['status' => 0]);
            }

        }
        event('order.refundAll', compact('order'));
    }

a46cc202211241713072828.png


3. 替换后重启 swoole 服务即可


被子你放开我 最后编辑于2022-11-25 11:23:35

回复({{post_count}})
回复从新到旧

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}} 作者 管理员 企业

{{item.user_info.title}}
{{item.created_at}}  {{item.user_info.ip_address}}
{{item.like_count}}
{{item.showReply ? '取消回复' : '回复'}}
删除
回复

{{itemc.user_info.nickname}}

{{itemc.user_name}}

作者 管理员 企业

回复 {{itemc.comment_user_info.nickname}}

{{itemc.created_at}}   {{itemc.user_info.ip_address}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回复' : '回复'}}
删除
回复
查看更多
回复
添加回复 ({{post_count}})
771
{{like_count}}
{{collect_count}}

相关推荐

无懈可击? 管理员
CRMEB 多商户

回答

27

发布

4

经验

2688

快速安全登录

使用微信扫码登录
经验说明

1、发布新帖子,每发布一条帖子可获得20个经验,每天最多可获取200个经验;

2、发布新回复,每发布一条回复可获得10个经验,每天最多可获取200个经验;

3、发布的帖子被管理员设置为精华帖,每被加精一次可获得10个经验,无上限;

4、发布帖子被回复一条,加2个经验,无上限;

5、发布帖子被点赞一个或发布评论被点赞加5个经验,无上限;

6、论坛首页大神积分排行榜,统计90天以内获取的累积经验值进行排序。

7、技术社区经验和官方商城用户经验同步,累计经验值会提升商城会员等级,购买官方商城产品享受对应会员等级折扣

确定
{{item.label}} 首页头条 首页动态 加精 板块推荐 取 消 确 定
回复

快速安全登录

使用微信扫码登录
CRMEB客服

CRMEB咨询热线 咨询热线

400-8888-794

微信扫码咨询

CRMEB开源商城下载 开源下载 CRMEB官方论坛 帮助文档
返回顶部 返回顶部
CRMEB客服