laravel take(3) 读取最近三条信息

laravel take(3) 读取最近三条信息

   //优惠文章列表
        $articel_list = DB::table('articles')->where([['is_delete', '=', '0'],
    ['cat_id', '=', '5'],
])->select('title', 'article_id','image')->orderBy('article_id', 'desc')->take(3)->get()->toArray();
        foreach ($articel_list as $key => $value) {
            $articel_list[$key] = (array) $value;
        }

 

posted @ 2019-07-22 14:45  多啦C梦  阅读(1241)  评论(0编辑  收藏  举报