6
0
Fork 0

order:profit update profit_paid

base
panliang 2022-08-04 14:39:14 +08:00
parent 741cd2bbe8
commit 522b1b06f4
1 changed files with 6 additions and 3 deletions

View File

@ -42,6 +42,7 @@ class OrderProfitCommand extends Command
*/
public function handle()
{
$service = new DistributeService();
// 售后过期天数 7
@ -78,9 +79,11 @@ class OrderProfitCommand extends Command
}
// 没有待付款的提成记录
// if (!$order->profits()->where('status', 0)->exists()) {
// $order->update(['profit_paid' => now()]);
// }
Order::where(fn($q) => $q->whereHas('profits', fn($q) => $q->where('status', 2))->orWhereDoesntHave('profits'))
// 售后期过了
->where('completed_at', '<', now()->subDays($saleDays))
->whereNull('profit_paid')
->update(['profit_paid' => now()]);
$page++;