diff --git a/app/Console/Commands/KttOrderQuery.php b/app/Console/Commands/KttOrderQuery.php index d94243e..d139c1a 100644 --- a/app/Console/Commands/KttOrderQuery.php +++ b/app/Console/Commands/KttOrderQuery.php @@ -15,7 +15,7 @@ class KttOrderQuery extends Command * * @var string */ - protected $signature = 'ktt:order_query'; + protected $signature = 'ktt:order_query {start?}'; /** * The console command description. @@ -44,9 +44,10 @@ class KttOrderQuery extends Command { $shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get(); $endTime = DateTimeUtils::getMicroTime(); - $beginTime = $endTime - 63000; + $start = $this->argument('start'); + $beginTime = $start??($endTime - 69000); foreach ($shops as $shop) { - BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime + 3000); + BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime - 6000); } } } diff --git a/app/Models/Shop.php b/app/Models/Shop.php index 8e7d8d0..a636c5f 100644 --- a/app/Models/Shop.php +++ b/app/Models/Shop.php @@ -4,10 +4,11 @@ namespace App\Models; use App\Models\traits\Filter; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class Shop extends Model { - use Filter; + use Filter,SoftDeletes; public static $PLAT_KTT = 1; public static $PLAT_MX = 0; diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index 1d8af29..2c28425 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -116,6 +116,7 @@ class KuaiTuanTuan extends BusinessClient [$type, $appendParams] = Order::downloadOrders($beginTime, $endTime, $page); $responseName = 'ktt_order_list_response'; } + $res = $this->doRequest($type, $appendParams); if (!isset($res[$responseName])) { return;