tel = $tel; if (!$user->save()) { throw new ErrorCodeException(ErrorCode::BIND_TEL_ERROR); } return true; } public function checkTel($userId) { $user = User::find($userId); return $user->tel ? true : false; } public function removeTel($userId) { $user = User::find($userId); $user->tel = ''; if (!$user->save()) { throw new ErrorCodeException(ErrorCode::UNBIND_TEL_ERROR); } return true; } }