From 30c6576d368ee2acc964268b8cf4d05b3a1aecb1 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Thu, 4 Aug 2022 14:40:42 +0800 Subject: [PATCH] order:profit update profit_paid --- app/Console/Commands/OrderProfitCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/OrderProfitCommand.php b/app/Console/Commands/OrderProfitCommand.php index 5377afff..d9d6e0cd 100644 --- a/app/Console/Commands/OrderProfitCommand.php +++ b/app/Console/Commands/OrderProfitCommand.php @@ -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()]);