diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index a332fe4..658154a 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -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; diff --git a/app/Http/Controllers/Business/BusinessGoodsSkusController.php b/app/Http/Controllers/Business/BusinessGoodsSkusController.php index 6280b78..80db651 100644 --- a/app/Http/Controllers/Business/BusinessGoodsSkusController.php +++ b/app/Http/Controllers/Business/BusinessGoodsSkusController.php @@ -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()) { diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index 238eef7..0870461 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -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); } } diff --git a/app/Services/Business/KuaiTuanTuan/FaceSheet.php b/app/Services/Business/KuaiTuanTuan/FaceSheet.php new file mode 100644 index 0000000..a635383 --- /dev/null +++ b/app/Services/Business/KuaiTuanTuan/FaceSheet.php @@ -0,0 +1,49 @@ +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); + } +} +