Explorar o código

feat(ThirdParty): 添加商品入库状态字段

- 新增数据库查询检查商品是否已入库
- 添加 importStatus 字段返回入库状态
- 优化商品信息返回结构
shichen hai 3 meses
pai
achega
ed3767d159
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      app/services/ThirdParty/AlibabaAgent/ProductService.php

+ 6 - 0
app/services/ThirdParty/AlibabaAgent/ProductService.php

@@ -318,6 +318,11 @@ class ProductService extends AlibabaAgentBaseService
318 318
         // --- 描述处理 ---
319 319
         $description = $productInfo['description'] ?? '';
320 320
 
321
+        // 入库状态
322
+        $importStatus = 0;
323
+        $import = Db::name('alibaba_import_goods')->where('product_id',$productInfo['productID'])->find();
324
+        if ($import) $importStatus = 1;
325
+
321 326
         return [
322 327
             'productId'     => $productInfo['productID'] ?? $productInfo['productId'] ?? 0,
323 328
             'categoryId'    => $productInfo['categoryID'] ?? $productInfo['categoryId'] ?? 0,
@@ -337,6 +342,7 @@ class ProductService extends AlibabaAgentBaseService
337 342
             'shopName'      => $wangwangAccount,
338 343
             'sellerOpenUid' => $item['sellerOpenUid'] ?? '',
339 344
             'serviceTags'   => $tagInfoList,
345
+            'importStatus'     => $importStatus,
340 346
         ];
341 347
     }
342 348