private function doctorData($user, $os, $app, $v) {/*{{{*/ $infos = array(); $doctorOwner = $user->getDoctorOwner(); $infos['userId'] = $user->id; $infos['userName'] = $user->name; $infos['userMobile'] = iconv('gbk', 'utf8', $user->mobile); $infos['doctorName'] = iconv('gbk', 'utf8', $doctorOwner->source->name); $infos['headImageUrl'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify() : $doctorOwner->source->getHeadImage(); $infos['bigHeadImageUrl'] = ($doctorOwner->isSpace()) ? $doctorOwner->source->getHeadImg4Modify(2400) : $doctorOwner->source->getHeadImage(2400); $infos['doctorOwnerId'] = $doctorOwner->id; $infos['spaceId'] = ($doctorOwner->source instanceof Space) ? $doctorOwner->source->id : '0'; $infos['responseTime'] = time(); $infos['isLevel4'] = 0; $infos['isFollowupDoctor'] = 0; if($doctorOwner->isSpace()) { $host = $doctorOwner->source->host; $infos['isLevel4'] = ($host->isAdminLevel3() || $host->isAdminLevel4()) ? 1 : 0; $infos['isFollowupDoctor'] = $doctorOwner->isOpenFollowup() ? 1 : 0; MobileSettingClient::getInstance()->createWapSpace($doctorOwner->source->id, $app, $os, $v); } return $infos; }/*}}}*/
public function vertifyUserCertificate($userId, $certificateToken, $app, $os, $v) {/*{{{*/ $info = array(); $info['isFollowupDoctor'] = 0; $user = DAL::get()->find('user', $userId); $info['freeFollowupUrl'] = "http://".URL_PREFIX."passport.haodf.com/user/mobileauthcheck?forward=".$user->space->getFreeFollowupFlowUrl(); if($user->isNull()) { $this->setErrorCode(107); return 0; } $certificateToken4Server = Datacrypt::getUserCertificate($userId); if($certificateToken4Server != $certificateToken) { $this->setErrorCode(501); return 0; } if($app == 'doctor' || $app == 'doctorhd') { MobileSettingClient::getInstance()->createWapSpace($user->space->id, $app, $os, $v); if($user->space->isDoctor() && $user->space->isOpenFollowup()) { $info['isFollowupDoctor'] = 1; } } $this->content = $info; }/*}}}*/
private function doctorData($user, $os, $app, $v) {/*{{{*/ $infos = array(); if (false == $user->isNull()) { $infos['userId'] = $user->id; $infos['doctorName'] = iconv('gbk', 'utf8', $user->space->name); $infos['headImageUrl'] = $user->space->host->getHeadImageForMobile(); $infos['spaceId'] = $user->space->id; $infos['responseTime'] = time(); $infos['doctorId'] = $user->space->host->id; $infos['isBookingOpened'] = 0; $infos['isLevel4'] = 0; $doctor = DAL::get()->find('doctor', $user->space->host->id); if($doctor->isDoctor() && $doctor->adminLevel == 4) { $infos['isLevel4'] = 1; } if($user->space->isBookingOpened()) { $infos['isBookingOpened'] = 1; } $infos['isFollowupDoctor'] = $user->space->isOpenFollowup() ? 1 : 0; MobileSettingClient::getInstance()->createWapSpace($user->space->id, $app, $os, $v); } return $infos; }/*}}}*/
public function delHolidaySetting($request, $response) { /*{{{*/ $id = $request->id; MobileSettingClient::getInstance()->delete($id); $response->setRedirect($response->router->urlfor('wap/holidaySettingList')); }