6
0
Fork 0
base
panliang 2023-10-13 10:06:50 +08:00
parent 5aca2d4119
commit c23990f7d3
2 changed files with 24 additions and 39 deletions

View File

@ -2,9 +2,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Enums\PayWay;
use App\Models\Order; use App\Models\Order;
use App\Models\OrderProfit;
use App\Services\DistributeService; use App\Services\DistributeService;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -16,7 +14,7 @@ class OrderProfitCommand extends Command
* *
* @var string * @var string
*/ */
protected $signature = 'order:profit'; protected $signature = 'order-profit:send';
/** /**
* The console command description. * The console command description.
@ -47,9 +45,6 @@ class OrderProfitCommand extends Command
// 售后过期天数 7 // 售后过期天数 7
$saleDays = app_settings('app.sale_after_expire_days'); $saleDays = app_settings('app.sale_after_expire_days');
while (true) {
$page = 0;
$orders = Order::query() $orders = Order::query()
// 订单已完成 // 订单已完成
->where('status', Order::STATUS_COMPLETED) ->where('status', Order::STATUS_COMPLETED)
@ -75,16 +70,5 @@ class OrderProfitCommand extends Command
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
} }
$page++;
if ($page === 0) {
sleep(60);
} elseif ($page === 1) {
sleep(30);
} else {
sleep(15);
}
}
} }
} }

View File

@ -24,6 +24,7 @@ class Kernel extends ConsoleKernel
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
$schedule->command('order-profit:send')->daily();
$schedule->command('order-profit:check')->daily(); $schedule->command('order-profit:check')->daily();
} }