(int)$model->id, 'username' => $model->username, 'name' => $model->name, // 'headimg' => $model->headimg, 'mobile' => $model->mobile, 'email' => $model->email, 'department' => $model->department, 'status' => $model->status, 'roles' => $model->rolesName, // 'role_id' => $model->role_id, // 'role_name' => $model->id == 1 ? '超级管理员' : ($model->role ? $model->role->name : '--'), 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT) ]; } }