我试图获取日期和课程名称的值,但我收到了这些错误异常。
环形:
array:2 [▼
0 => Collection {#284 ▼
#items: array:3 [▼
0 => {#277 ▼
+"date": "2018"
}
1 => {#279 ▶}
4 => {#282 ▶}``
]
}
1 => Collection {#283 ▼
#items: array:2 [▼
0 => {#280 ▼
+"id": 1
+"courseName": "newc1"
}
1 => {#271 ▶}
]
}
]
//tried these
@foreach ($result as $key=> $value)
@foreach ($value as $val)
{{$val->date}}
@endforeach
@endforeach
//controller
$data = array();
$date = db::table('students')->select('date')->get()->unique();
$course = db::table('courses')->select('id', 'courseName')->get();
array_push($data, $date, $course);
需要遍历这些。而是得到了 ErrorException (E_ERROR) 未定义的属性:stdClass::$date
慕娘9325324