From 5c4b8000c2fc2e046161bf00b53b3be189045108 Mon Sep 17 00:00:00 2001 From: guojia <445241500@qq.com> Date: Thu, 25 Apr 2024 10:55:49 +0800 Subject: [PATCH] delete code --- app/common/model/Merchant.php | 48 ++--------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/app/common/model/Merchant.php b/app/common/model/Merchant.php index 0526a279..f55bb183 100644 --- a/app/common/model/Merchant.php +++ b/app/common/model/Merchant.php @@ -42,57 +42,13 @@ class Merchant extends BaseModel * @param int $storeId * @return static|array|null */ - public static function detail(int $storeId) + public static function detail(int $merchantId) { try { $list = self::withoutGlobalScope() ->with(['logoImage']) - ->where('store_id', '=', $storeId) + ->where('merchant_id', '=', $merchantId) ->find(); - if ($list) { - if ($list['new_product_img_id']) { - $img_ids = explode(",", $list['new_product_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['newProductImg'] = $files ?: null; - } else { - $list['newProductImg'] = null; - } - if ($list['big_brand_img_id']) { - $img_ids = explode(",", $list['big_brand_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['bigBrandImg'] = $files ?: null; - } else { - $list['bigBrandImg'] = null; - } - if ($list['new_people_order_img_id']) { - $img_ids = explode(",", $list['new_people_order_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['newPeopleOrderImg'] = $files ?: null; - } else { - $list['newPeopleOrderImg'] = null; - } - if ($list['presale_img_id']) { - $img_ids = explode(",", $list['presale_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['presaleImg'] = $files ?: null; - } else { - $list['presaleImg'] = null; - } - if ($list['flash_sale_img_id']) { - $img_ids = explode(",", $list['flash_sale_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['flashSaleImg'] = $files ?: null; - } else { - $list['flashSaleImg'] = null; - } - if ($list['ranking_img_id']) { - $img_ids = explode(",", $list['ranking_img_id']); - $files = UploadFile::getFileList($img_ids); - $list['rankingImg'] = $files ?: null; - } else { - $list['rankingImg'] = null; - } - } return $list ?? null; } catch (\Exception $e) { return null;