erp/app/Console/Commands/Test.php

78 lines
2.0 KiB
PHP
Raw Normal View History

2022-08-08 16:00:47 +08:00
<?php
namespace App\Console\Commands;
2022-08-24 18:09:34 +08:00
use App\Models\GoodsSku;
2022-08-08 16:00:47 +08:00
use App\Models\Shop;
use App\Services\Business\BusinessFactory;
2022-08-09 10:34:36 +08:00
use App\Utils\DateTimeUtils;
2022-08-08 16:00:47 +08:00
use Illuminate\Console\Command;
class Test extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test';
/**
* The console command description.
*
* @var string
*/
protected $description = '测试';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
2022-08-24 18:09:34 +08:00
// 下架商品
// GoodsSku::where('status', '<>', 0)->update(['status' => 0]);
// $this->info('全部下架');
// exit();
// 1-7 11
// $shop = Shop::query()->find(11);
// $business = BusinessFactory::init()->make($shop->plat_id);
// $business->setShop($shop);
2022-08-09 10:34:36 +08:00
// 下载商品列表
// $business->downloadGoodsListAndBind();
2022-08-09 10:34:36 +08:00
// 下载单个商品
// $business->downloadGoods(1);
// 库存修改
// $business->incrQuantity(1);
2022-08-09 10:34:36 +08:00
// 订单下载
2022-08-24 18:09:34 +08:00
// $beginTime = DateTimeUtils::getMicroTime('2022-08-23 00:00:00');
// $endTime = DateTimeUtils::getMicroTime('2022-08-24 00:00:00');
// $business->downloadOrdersAndSave($beginTime, $endTime);
2022-08-09 10:34:36 +08:00
2022-08-24 18:09:34 +08:00
// $shops = Shop::query()->where('status', 1)->get();
// $that = $this;
// foreach ($shops as $shop) {
// $business = BusinessFactory::init()->make($shop->plat_id);
// $business->setShop($shop);
// $beginTime = DateTimeUtils::getMicroTime('2022-08-10 00:00:00');
// $endTime = DateTimeUtils::getMicroTime('2022-08-11 00:00:00');
// $business->downloadOrdersAndSave($beginTime, $endTime);
// $that->info($shop->name);
// }
2022-08-08 16:00:47 +08:00
}
}