commit
80dc93d138
@ -12,6 +12,7 @@ use App\Models\Log;
|
||||
use App\Models\Shop;
|
||||
use App\Models\TodayPrice;
|
||||
use App\Services\Business\BusinessFactory;
|
||||
use App\Services\Business\KuaiTuanTuan\FaceSheet;
|
||||
use App\Utils\DateTimeUtils;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@ -155,17 +155,16 @@ class BusinessGoodsSkusController extends Controller
|
||||
if (!isset($res['ktt_group_query_list_response'])) {
|
||||
continue;
|
||||
}
|
||||
$activityNos = $activities = [];
|
||||
$activities = [];
|
||||
foreach ($res['ktt_group_query_list_response']['activity_list'] as $activity) {
|
||||
$title = str_replace(' ', '', $activity['title']);
|
||||
if (0 === $activity['is_help_sell'] && !in_array($title, $noActivityTitle, true)) {
|
||||
$activityNos[] = $activity['activity_no'];
|
||||
$activities[$activity['activity_no']] = $activity['title'];
|
||||
}
|
||||
}
|
||||
$businessGoodsSkus = BusinessGoodsSku::query()
|
||||
->where('shop_id', $shop->id)
|
||||
->whereIn('activity_no', $activityNos)
|
||||
->whereIn('activity_no', array_keys($activities))
|
||||
->orderBy('activity_no')
|
||||
->get(['shop_id', 'title', 'activity_no', 'goods_name', 'price_in_fen', 'external_sku_id']);
|
||||
if ($businessGoodsSkus->isEmpty()) {
|
||||
|
||||
@ -164,7 +164,6 @@ abstract class BusinessClient
|
||||
|
||||
public function batchAsyncPostRequest($url, $batchParams)
|
||||
{
|
||||
LogFile::info(json_encode($batchParams, 256));
|
||||
$client = new Client();
|
||||
$promises = [];
|
||||
foreach ($batchParams as $param) {
|
||||
@ -174,9 +173,6 @@ abstract class BusinessClient
|
||||
];
|
||||
$promises[] = $client->postAsync($url, $options);
|
||||
}
|
||||
$res = Promise\Utils::unwrap($promises);
|
||||
foreach ($res as $item) {
|
||||
LogFile::info($item->getBody()->getContents());
|
||||
}
|
||||
Promise\Utils::unwrap($promises);
|
||||
}
|
||||
}
|
||||
|
||||
49
app/Services/Business/KuaiTuanTuan/FaceSheet.php
Normal file
49
app/Services/Business/KuaiTuanTuan/FaceSheet.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Business\KuaiTuanTuan;
|
||||
|
||||
class FaceSheet extends KuaiTuanTuan
|
||||
{
|
||||
/**
|
||||
* 快递公司查看接口
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCompanies()
|
||||
{
|
||||
$type = 'pdd.logistics.companies.get';
|
||||
$appendParams = [];
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* searchWayBill
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function searchWayBill()
|
||||
{
|
||||
$type = 'pdd.waybill.search';
|
||||
$appendParams = [];
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
|
||||
public function getLogisticsOrderTrance()
|
||||
{
|
||||
$type = 'pdd.logistics.ordertrace.get';
|
||||
$appendParams = [];
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$type = 'pdd.cloudprint.stdtemplates.get';
|
||||
$appendParams = [];
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user