feat: 完善商品计奖隔离、积分商城兑换券抵扣与下线售后退款入口

这个提交包含在:
chen
2026-09-17 16:55:08 +08:00
父节点 f5b804fb57
当前提交 c3f5b3d4b5
共有 22 个文件被更改,包括 720 次插入 和 183 次删除

查看文件

@@ -38,12 +38,9 @@ class ActiveService
public function hasQualifiedOrder($userId, $start, $end)
{
$order = OrderModel::where('user_id', $userId)
->where('type', '<>', 'score')
->where('pay_fee', '>', 0)
->paid()
->where('paid_time', '>=', $start)
->where('paid_time', '<=', $end)
$rateService = new RateService();
$order = $rateService->qualifiedOrderQuery($start, $end)
->where('o.user_id', $userId)
->find();
return (bool) $order;
}
@@ -72,15 +69,11 @@ class ActiveService
})->column('user_id');
if (!empty($nullUserIds)) {
$orderHits = \think\Db::name('shopro_order')
->whereIn('user_id', $nullUserIds)
->where('type', '<>', 'score')
->where('pay_fee', '>', 0)
->whereIn('status', ['paid', 'completed'])
->where('paid_time', '>=', $start)
->where('paid_time', '<=', $end)
->group('user_id')
->column('max(paid_time)', 'user_id');
$rateService = new RateService();
$orderHits = $rateService->qualifiedOrderQuery($start, $end)
->whereIn('o.user_id', $nullUserIds)
->group('o.user_id')
->column('max(o.paid_time)', 'o.user_id');
foreach ($orderHits as $uId => $lastTime) {
\think\Db::name('shopro_commission_agent')->where('user_id', $uId)->update(['last_self_order_time' => $lastTime]);