丿轻羽丶 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 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘