order:profit update profit_paid
parent
522b1b06f4
commit
30c6576d36
|
|
@ -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()]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue