6
0
Fork 0

order:profit update profit_paid

base
panliang 2022-08-04 14:40:42 +08:00
parent 522b1b06f4
commit 30c6576d36
1 changed files with 5 additions and 0 deletions

View File

@ -80,8 +80,13 @@ class OrderProfitCommand extends Command
// 没有待付款的提成记录
Order::where(fn($q) => $q->whereHas('profits', fn($q) => $q->where('status', 2))->orWhereDoesntHave('profits'))
// 订单已完成
->where('status', Order::STATUS_COMPLETED)
// 没有售后订单
->whereDoesntHave('afterSales')
// 售后期过了
->where('completed_at', '<', now()->subDays($saleDays))
// 未支付提成
->whereNull('profit_paid')
->update(['profit_paid' => now()]);