优化首页查询数据

This commit is contained in:
hdm 2022-05-26 08:16:28 +08:00
parent b8a13765c1
commit ef9bf4794e

View File

@ -194,7 +194,7 @@ class Index extends BaseController
public function get_note_list()
{
$list = Db::name('Note')
->field('a.*,c.title as cate_title')
->field('a.id,a.title,a.create_time,c.title as cate_title')
->alias('a')
->join('note_cate c', 'a.cate_id = c.id')
->where(['a.status' => 1])
@ -212,7 +212,7 @@ class Index extends BaseController
public function get_article_list()
{
$list = Db::name('Article')
->field('a.*,c.title as cate_title')
->field('a.id,a.title,a.create_time,a.read,c.title as cate_title')
->alias('a')
->join('article_cate c', 'a.article_cate_id = c.id')
->where(['a.status' => 1])