From f7dc9977acdb1b4b89406051ae724c483964426f Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Thu, 22 Jan 2026 15:25:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E6=88=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E8=BF=87=E5=BE=AE=E4=BF=A1=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=85=8D=E7=BD=AE=E6=90=9C=E7=B4=A2=E5=95=86?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加可选项允许在商户管理中通过微信小程序的配置信息进行关键字搜索。当启用该选项时,搜索条件将包含微信小程序的配置值。同时修改了关联查询以包含微信小程序的配置表。 --- src/app/platform/controller/Shop.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/platform/controller/Shop.php b/src/app/platform/controller/Shop.php index a38eaec1b..14200fcd4 100644 --- a/src/app/platform/controller/Shop.php +++ b/src/app/platform/controller/Shop.php @@ -46,15 +46,27 @@ class Shop extends BasePlatform $condition[] = [ 'u.status', '=', $status ]; } // $condition[] = [ 'site_id', '=', $this->site_id ]; + + // 是否允许通过查询微信小程序中的配置,找到匹配的商户 + $enable_search_in_weapp = false; + //关键字查询 if (!empty($keyword)) { - $condition[] = ['s.site_name|s.site_id', 'like', '%' . $keyword . '%']; + if ($enable_search_in_weapp) { + $condition[] = ['s.site_name|s.site_id|c.value', 'like', '%' . $keyword . '%']; + } else { + $condition[] = ['s.site_name|s.site_id', 'like', '%' . $keyword . '%']; + } } $order = 'p.uniacid desc'; $join = [ ['site s','s.site_id = p.uniacid','left'], ['user u','u.site_id = p.uniacid','left'], ]; + if ($enable_search_in_weapp) { + $join[] = ['config c', 'c.site_id = p.uniacid and c.config_key = "WEAPP_CONFIG"', 'left']; + } + $list = $Comm_model->getPageList('platform_shop',$condition, $page, $page_size, $order,'p.*,s.site_realname,s.end_time,s.site_tel,s.logo,u.status as ustatus,u.uid','p',$join); // file_put_contents(__DIR__ . '/debug.txt', var_export(Db::getLastSql(),true)); foreach($list['data']['list'] as &$row){