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; }