Browse Source

修改

master
jianglong 4 years ago
parent
commit
f8c9e58539
  1. 4
      app/api/model/Content.php

4
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_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']:''; $table_base = in_array($module_info['table_name'],config('cms.base_module'))?$module_info['table_name']:'';
//获取内容列表 //获取内容列表
$_op = Db::name('cms_common')->alias('cms_common'); $_op = Db::name('cms_common')->alias('cms_common');
if(in_array($table_name,Db::getTables())){ if(in_array($table_name,Db::getTables())){
$_op->join("{$table_name} {$table_name}","cms_common.id={$table_name}.common_id",'left'); $_op->join("{$table_name} {$table_name}","cms_common.id={$table_name}.common_id",'left');
} }
if($table_base!=''){ if($table_base!=''){
$table_base = 'cms_'.$table_base; $table_base = 'cms_'.$table_base;
$_op->join("{$table_base} {$table_base}","cms_common.id={$table_base}.common_id",'left'); $_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('delete_time is null');
$_op->where('site_id',SITE_ID); $_op->where('site_id',SITE_ID);
$_op->where('cate_id',$cate_id);
$_op->where('template_id',TEMPLATE_ID); $_op->where('template_id',TEMPLATE_ID);
//执行分页查询 //执行分页查询
$page = $this->request->param('page', config('page')); $page = $this->request->param('page', config('page'));

Loading…
Cancel
Save