syncPackageInfo.php 726 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\DataApi\Helper\PackageHelper;
  4. use Illuminate\Support\Facades\Log;
  5. class syncPackageInfo extends \Illuminate\Console\Command
  6. {
  7. protected $signature = "saler_package_info:sync";
  8. protected $description = 'saler_package_info sync';
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. }
  13. public function handle()
  14. {
  15. $PackageHelper = new PackageHelper();
  16. $PackageHelper->syncPackageInfo();
  17. Log::info('更新套餐标签信息成功,请等待下次更新');
  18. $i = 0;
  19. //10分钟同步一次
  20. while ($i < 600) {
  21. sleep(1);
  22. $i++;
  23. }
  24. $this->handle();
  25. }
  26. }