💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[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(); ~~~