From a5ffdae069003cc2e5d60a310e962ce1664a699e Mon Sep 17 00:00:00 2001 From: guojia <445241500@qq.com> Date: Sun, 28 Apr 2024 21:26:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/Merchant.php | 15 +++++++++++++-- app/store/controller/Merchant.php | 8 -------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/common/model/Merchant.php b/app/common/model/Merchant.php index 3f39f2ce..48632ae4 100644 --- a/app/common/model/Merchant.php +++ b/app/common/model/Merchant.php @@ -73,11 +73,22 @@ class Merchant extends BaseModel */ public function getList(array $param = []): \think\Paginator { - return $this->with(['logoImage']) + $res = $this->with(['logoImage']) ->where($this->getFilter($param)) ->where('is_delete', '=', 0) ->order(['sort' => 'asc', $this->getPk()]) - ->paginate(15); + ->paginate(15)->toArray(); + + foreach ($res as $kr => $r) { + $res[$kr]['licenseImg'] = []; + if ($r['license_img_id']) { + $img_ids = explode(",", $r['license_img_id']); + $files = UploadFile::getFileList($img_ids); + $res[$kr]['licenseImg'] = $files ?: null; + } + } + + return $res; } /** diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index 6c782f67..0615994f 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -115,14 +115,6 @@ class Merchant extends Controller return $this->renderSuccess(compact('list')); } - /** - * 门店入驻详情 - */ - public function settleDetail(int $id): Json - { - $detail = MerchantModel::get($id); - return $this->renderSuccess(compact('detail')); - } /** * 更新商城信息