AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
>[danger] 指定查询的字段并设置别名 ~~~ DB::table('users')->select('username as name', 'id')->get(); ~~~ >[danger] 给已经构建好的查询添加更多字段 ~~~ $base = DB::table('users') ->select('username as name', 'id'); $data = $base->addSelect('password')->get(); ~~~ >[danger] 内部原生表达式 ~~~ $data = DB::table('users') ->select(DB::raw('concat("id", "username")')) ->groupBy('password') ->get(); ~~~ ~~~ $data = DB::table('users') ->selectRaw('count(*) as count') ->groupBy('password') ->havingRaw('count > 1') ->get(); ~~~