From f8c9e58539bc4fb6e3438ef97c629bd4c291fb67 Mon Sep 17 00:00:00 2001 From: jianglong <974886602@qq.com> Date: Sun, 26 Jun 2022 11:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/model/Content.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/model/Content.php b/app/api/model/Content.php index 219ffef..6a021e1 100644 --- a/app/api/model/Content.php +++ b/app/api/model/Content.php @@ -66,11 +66,14 @@ class Content extends CmsCommon $table_name = $this->cms_table.'_'.$module_info['table_name'].'_'.$site_id; $table_base = in_array($module_info['table_name'],config('cms.base_module'))?$module_info['table_name']:''; + //获取内容列表 $_op = Db::name('cms_common')->alias('cms_common'); + if(in_array($table_name,Db::getTables())){ $_op->join("{$table_name} {$table_name}","cms_common.id={$table_name}.common_id",'left'); } + if($table_base!=''){ $table_base = 'cms_'.$table_base; $_op->join("{$table_base} {$table_base}","cms_common.id={$table_base}.common_id",'left'); @@ -96,6 +99,7 @@ class Content extends CmsCommon $_op->where('delete_time is null'); $_op->where('site_id',SITE_ID); + $_op->where('cate_id',$cate_id); $_op->where('template_id',TEMPLATE_ID); //执行分页查询 $page = $this->request->param('page', config('page')); @@ -107,7 +111,7 @@ class Content extends CmsCommon //无分页判断 $_op->page((int)$page, (int)$limit); $data = $_op->select()->toArray(); - + $data = $this->haddle_format_output($data,$field_info); $field_infos = [];