Exemplo n.º 1
0
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $option['commentPercentage'] = '0.6';
     $option['rate1Count'] = '0';
     $option['goodVoteCount'] = '2';
     $commentDoctorExts = CommentDoctorExtClient::getInstance()->queryCommentDoctorExtsByOption4SoSo($option, $nowPage, $pageSize);
     if (empty($commentDoctorExts))
     {
         return array();
     }
     $doctorIds = $this->getDoctorIds($commentDoctorExts);
     $comments = $this->getDoctorCommentList($doctorIds);
     $diseaseDoctors = DoctorClient::getInstance()->getDiseaseDoctorListGroupByDoctor($doctorIds);
     BeanFinder::get('LocalCache')->removeAll(); 
     return $this->buildData($commentDoctorExts, $comments, $diseaseDoctors);
 }/*}}}*/
 public function updatePost($request, $response)
 {
     /*{{{*/
     //dodo::psq
     $trustIndex = $request->getRequest('trustIndex', 0);
     $commentDoctorId = $request->getRequest('commentDoctorId', 0);
     $punishDay = $request->getRequest('punishDay', 0);
     $remark = $request->reason;
     $this->checkDates($trustIndex, $punishDay, $remark, $commentDoctorId);
     $user = UserClient::getInstance()->getCurrentUser();
     $commentDoctor = DAL::get()->find('commentdoctorext', $commentDoctorId);
     $punishEndTime = $this->getPunishEndTime($commentDoctor, $punishDay);
     $remarkOfDoctor = "医生信用值由<font color='red' >" . $commentDoctor->trustIndex . "</font>改成<font color='red'>" . $trustIndex . "</font>;" . ($punishDay > 0 ? "点评入口操作:惩罚时间到<font color='red'>" . $punishEndTime . "</font>" : "") . ($punishDay < 0 ? "点评入口操作:<font color='red'>打开点评口</font>" : ";") . "<br>管理员备注:<font color='red'>" . $remark . "</font>";
     $isRole = $this->checkRole($commentDoctor, $request->trustIndex);
     if ($isRole == false) {
         $response->setRedirect("/commentdoctor/edit?id=" . $commentDoctorId . "&msg=" . urlencode('更新失败,没有权限修改信用值'));
         return false;
     }
     $id = CommentDoctorExtClient::getInstance()->modify($commentDoctorId, $user, $remark, $trustIndex, $punishEndTime, $request->needevidence);
     if ($id) {
         S3LogClient::getInstance()->add($this->inspector, $commentDoctor->getLogable()->action(CommentDoctorLog::ACTION_MODIFY_DOCTORINFO, $remarkOfDoctor));
         $response->setRedirect("/commentdoctor/edit?id={$id}&msg=" . urlencode('更新成功'));
     }
 }