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){