mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
fix: #09090 优化快团团商品下载
This commit is contained in:
parent
78a122bd4c
commit
c4ce86cf10
@ -3,6 +3,7 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Models\GoodsSku;
|
use App\Models\GoodsSku;
|
||||||
|
use App\Models\Log;
|
||||||
use App\Models\Shop;
|
use App\Models\Shop;
|
||||||
use App\Services\Business\BusinessFactory;
|
use App\Services\Business\BusinessFactory;
|
||||||
use App\Utils\DateTimeUtils;
|
use App\Utils\DateTimeUtils;
|
||||||
|
|||||||
@ -5,7 +5,8 @@ namespace App\Services\Business\KuaiTuanTuan;
|
|||||||
use App\Models\BusinessGoodsSku;
|
use App\Models\BusinessGoodsSku;
|
||||||
use App\Models\GoodsSku;
|
use App\Models\GoodsSku;
|
||||||
use App\Services\Business\BusinessClient;
|
use App\Services\Business\BusinessClient;
|
||||||
use Illuminate\Support\Facades\Log;
|
use App\Models\Log;
|
||||||
|
use App\Utils\DateTimeUtils;
|
||||||
|
|
||||||
class KuaiTuanTuan extends BusinessClient
|
class KuaiTuanTuan extends BusinessClient
|
||||||
{
|
{
|
||||||
@ -41,6 +42,18 @@ class KuaiTuanTuan extends BusinessClient
|
|||||||
public function downloadGoodsListAndBind($page = 1)
|
public function downloadGoodsListAndBind($page = 1)
|
||||||
{
|
{
|
||||||
[$type, $appendParams] = Goods::downloadGoods($this->shop->owner_id, $page);
|
[$type, $appendParams] = Goods::downloadGoods($this->shop->owner_id, $page);
|
||||||
|
$log = Log::query()
|
||||||
|
->where('target_field', 'pdd.ktt.goods.query.list')
|
||||||
|
->where('target_id', $this->shop->id)
|
||||||
|
->orderBy('id', 'desc')
|
||||||
|
->first();
|
||||||
|
if ($log) {
|
||||||
|
$lastGetTime = DateTimeUtils::getMicroTime($log->created_at);
|
||||||
|
// 毫秒时间戳,往前算3分钟
|
||||||
|
$startTime = $lastGetTime - 30000;
|
||||||
|
$appendParams['update_time_start'] = $startTime;
|
||||||
|
$appendParams['update_time_end'] = DateTimeUtils::getMicroTime();
|
||||||
|
}
|
||||||
$res = $this->doRequest($type, $appendParams);
|
$res = $this->doRequest($type, $appendParams);
|
||||||
$goods = $res['ktt_goods_query_list_response']['goods_list'];
|
$goods = $res['ktt_goods_query_list_response']['goods_list'];
|
||||||
$this->bindGoods($goods);
|
$this->bindGoods($goods);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user