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