mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
55 lines
1.0 KiB
PHP
55 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\GoodsSku;
|
|
use App\Models\Shop;
|
|
use App\Services\Business\BusinessFactory;
|
|
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()
|
|
{
|
|
$shop = Shop::query()->find(2);
|
|
$business = BusinessFactory::init()->make($shop->plat_id);
|
|
$business->setShop($shop);
|
|
// 下载商品
|
|
$business->downloadGoods(1);
|
|
|
|
// 库存修改
|
|
// $business->incrQuantity(1);
|
|
|
|
$this->info('执行测试成功');
|
|
}
|
|
}
|