From bebbd7083d99a09a9a7022f22f7365c9c7381e61 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Fri, 27 Dec 2024 11:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD=E5=95=86?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase_product_offer/PurchaseProductOfferLists.php | 4 ++++ .../model/purchase_product_offer/PurchaseProductOffer.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php index 88a0faadb..02b6416c8 100644 --- a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -57,6 +57,10 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item) use(&$cateIds, &$supplierIds, &$unitIds) { + $item->store_info = empty($item['store_info']) ? ($item['product']['store_info'] ?? '') : $item['store_info']; + $item->after_sales = empty($item['after_sales']) ? ($item['product']['after_sales'] ?? '') : $item['after_sales']; + $item->marques = empty($item['marques']) ? ($item['product']['marques'] ?? '') : $item['marques']; + $item->package = empty($item['package']) ? ($item['product']['package'] ?? '') : $item['package']; $item->store_name=$item->product->store_name ?? ''; $item->image=$item->product->image ?? ''; $cateIds[] = $item->product->top_cate_id ?? 0; diff --git a/app/common/model/purchase_product_offer/PurchaseProductOffer.php b/app/common/model/purchase_product_offer/PurchaseProductOffer.php index ba02ef4cb..54b111504 100644 --- a/app/common/model/purchase_product_offer/PurchaseProductOffer.php +++ b/app/common/model/purchase_product_offer/PurchaseProductOffer.php @@ -24,7 +24,7 @@ class PurchaseProductOffer extends BaseModel public function product() { - return $this->hasOne(StoreProduct::class, 'id', 'product_id')->field('id,store_name,top_cate_id,image'); + return $this->hasOne(StoreProduct::class, 'id', 'product_id')->field('id,store_name,top_cate_id,image,store_info,package,marques,after_sales'); } } \ No newline at end of file