(int)$model->id, 'username' => $model->username, 'name' => $model->name, 'headimg' => $model->headimg, 'department_id' => $model->department_id, 'department_name' => $model->department ? $model->department->name : '--', 'status' => $model->status, 'role_id' => $model->role_id, 'role_name' => $model->id == 1 ? '超级管理员' : ($model->role ? $model->role->name : '--'), 'shop_ids' => $model->shop_ids, 'shops_name' => in_array(0, $model->shop_ids) ? ['全部'] : Shop::query()->whereIn('id', $model->shop_ids)->pluck('name'), 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT) ]; } }