erp/app/Console/Commands/Test.php

60 lines
1.4 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Events\StockUpdateEvent;
use App\Models\BusinessGoodsSku;
use App\Models\BusinessOrder;
use App\Models\GoodsSku;
use App\Models\Log;
use App\Models\Shop;
use App\Services\Business\BusinessFactory;
use App\Utils\DateTimeUtils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Jobs\BusinessGoodsSkuIncrQuantity;
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(1);
$business = BusinessFactory::init()->make($shop->plat_id);
$business->setShop($shop);
$order = BusinessOrder::query()->where('shop_id', 1)->where('participate_no', 6436)->first();
// $res = $business->getOrderInfo($order->order_sn);
$endTime = DateTimeUtils::getMicroTime();
$beginTime = $endTime - 3000;
$res = $business->getOrderInfo($beginTime, $endTime + 3000);
}
}