丿轻羽丶 2016-09-17 05:20 采纳率: 0%
浏览 5718

laravel 数据库查询 多余字段

我在laravel框架执行数据库查询语句时
public function showRoom(){
$list = $this -> where('status','=','1')->get();
return $list;
}

返回一堆多余的信息怎么关闭

object(Illuminate\Database\Eloquent\Collection)#136 (1) {
["items":protected]=>
array(2) {
[0]=>
object(App\Http\Controllers\Model\Meeting)#137 (23) {
["hidden":protected]=>
array(1) {
[0]=>
string(5) "items"
}
["table":protected]=>
string(11) "meetingroom"
["connection":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(4) {
["id"]=>
int(1)
["name"]=>
string(13) "1号会议室"
["allow_people"]=>
int(10)
["status"]=>
int(1)
}
["original":protected]=>
array(4) {
["id"]=>
int(1)
["name"]=>
string(13) "1号会议室"
["allow_people"]=>
int(10)
["status"]=>
int(1)
}
["relations":protected]=>
array(0) {
}
["visible":protected]=>
array(0) {
}
["appends":protected]=>
array(0) {
}
["fillable":protected]=>
array(0) {
}
["guarded":protected]=>
array(1) {
[0]=>
string(1) "*"
}
["dates":protected]=>
array(0) {
}
["dateFormat":protected]=>
NULL
["casts":protected]=>
array(0) {
}
["touches":protected]=>
array(0) {
}
["observables":protected]=>
array(0) {
}
["with":protected]=>
array(0) {
}
["morphClass":protected]=>
NULL
["exists"]=>
bool(true)
["wasRecentlyCreated"]=>
bool(false)
}
[1]=>
object(App\Http\Controllers\Model\Meeting)#138 (23) {
["hidden":protected]=>
array(1) {
[0]=>
string(5) "items"
}
["table":protected]=>
string(11) "meetingroom"
["connection":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(4) {
["id"]=>
int(2)
["name"]=>
string(13) "2号会议室"
["allow_people"]=>
int(20)
["status"]=>
int(1)
}
["original":protected]=>
array(4) {
["id"]=>
int(2)
["name"]=>
string(13) "2号会议室"
["allow_people"]=>
int(20)
["status"]=>
int(1)
}
["relations":protected]=>
array(0) {
}
["visible":protected]=>
array(0) {
}
["appends":protected]=>
array(0) {
}
["fillable":protected]=>
array(0) {
}
["guarded":protected]=>
array(1) {
[0]=>
string(1) "*"
}
["dates":protected]=>
array(0) {
}
["dateFormat":protected]=>
NULL
["casts":protected]=>
array(0) {
}
["touches":protected]=>
array(0) {
}
["observables":protected]=>
array(0) {
}
["with":protected]=>
array(0) {
}
["morphClass":protected]=>
NULL
["exists"]=>
bool(true)
["wasRecentlyCreated"]=>
bool(false)
}
}
}

  • 写回答

2条回答 默认 最新

  • Leung0826 2016-09-17 07:45
    关注

    不用关闭,前台遍历的时候用 ->取值就行了

    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献