kernel
parent
5aca2d4119
commit
c23990f7d3
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue