erp/app/Console/Commands/Test.php

49 lines
911 B
PHP
Raw Normal View History

2022-08-08 16:00:47 +08:00
<?php
namespace App\Console\Commands;
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);
$res = $business->downloadGoods();
var_dump($res);
}
}