diff --git a/app/Console/Commands/Dealer/OrderProcessCommand.php b/app/Console/Commands/Dealer/OrderProcessCommand.php index 5f120dd2..98d84e28 100644 --- a/app/Console/Commands/Dealer/OrderProcessCommand.php +++ b/app/Console/Commands/Dealer/OrderProcessCommand.php @@ -401,6 +401,8 @@ class OrderProcessCommand extends Command continue; } + $qty = $product->qty + $product->deposit_qty; + // 同等级管理津贴最多给三次 if ($last === null || $dealer->lvl->value > $last->lvl->value) { if ($ranking < 3 && $dealer->lvl === DealerLvl::Top) { @@ -415,8 +417,8 @@ class OrderProcessCommand extends Command 'order_id' => $product->order_id, 'product_id' => $product->product_id, 'lvl' => $dealer->lvl, - 'sales_volume' => $product->qty, - 'total_amount' => bcmul($product->qty, $secondarySubsidy, 2), + 'sales_volume' => $qty, + 'total_amount' => bcmul($qty, $secondarySubsidy, 2), 'created_at' => $tz, 'updated_at' => $tz, ]; @@ -439,8 +441,8 @@ class OrderProcessCommand extends Command 'order_id' => $product->order_id, 'product_id' => $product->product_id, 'lvl' => $dealer->lvl, - 'sales_volume' => $product->qty, - 'total_amount' => bcmul($product->qty, $subsidy, 2), + 'sales_volume' => $qty, + 'total_amount' => bcmul($qty, $subsidy, 2), 'created_at' => $tz, 'updated_at' => $tz, ]; @@ -501,12 +503,14 @@ class OrderProcessCommand extends Command $logs = []; foreach ($dealerOrder->products as $product) { + $qty = $product->qty + $product->deposit_qty; + $logs[] = [ 'user_id' => $manager->user_id, 'lvl' => $manager->lvl, 'order_id' => $product->order_id, 'product_id' => $product->product_id, - 'sales_volume' => $product->qty, + 'sales_volume' => $qty, 'created_at' => $tz, 'updated_at' => $tz, ];