diff --git a/app/Console/Commands/OrderProfitCommand.php b/app/Console/Commands/OrderProfitCommand.php index 9928ff09..c9e6ae32 100644 --- a/app/Console/Commands/OrderProfitCommand.php +++ b/app/Console/Commands/OrderProfitCommand.php @@ -67,7 +67,7 @@ class OrderProfitCommand extends Command OrderProfit::whereIn('order_id', $orders->pluck('id'))->where('status', 0)->update(['status' => 4]); // 获取 等待结算 的提成记录, 按照 user_id 分组 - $list = OrderProfit::where('status', 4)->get()->groupBy('user_id'); + $list = OrderProfit::where('status', 4)->whereIn('order_id', $orders->pluck('id'))->get()->groupBy('user_id'); foreach($list as $id => $items) { try { DB::beginTransaction();