public function user()
{
$user=UserModel::select();
if($user) {
$user = collection($user)->toArray();
}
foreach ($user as $k => $v) {
$user= $v;
}
博客列表 >tp5模型转数组
public function user()
{
$user=UserModel::select();
if($user) {
$user = collection($user)->toArray();
}
foreach ($user as $k => $v) {
$user= $v;
}