laravel中使用model怎样得到指定字段信息
2 回答

慕粉2310427102
TA贡献1条经验 获得超0个赞
$list = District::where('level','province') ->get(['id','title as text']);

胡说叔叔
TA贡献1804条经验 获得超8个赞
指定查询子句 (Select Clause)
$users = DB::table('users')->select('name', 'email')->get();
$users = DB::table('users')->distinct()->get();
$users = DB::table('users')->select('name as user_name')->get();
希望可以帮到你!~~
- 2 回答
- 0 关注
- 3941 浏览
添加回答
举报
0/150
提交
取消