$userId])->field($field) ->findOrEmpty(); $user['channel'] = UserTerminalEnum::getTermInalDesc($user['channel']); $user->sex = $user->getData('sex'); return $user->toArray(); } /** * @notes 更新用户信息 * @param array $params * @return User * @author 乔峰 * @date 2022/9/22 16:38 */ public static function setUserInfo(array $params) { return User::update([ 'id' => $params['id'], $params['field'] => $params['value'] ]); } }