当前位置: 首页>>代码示例>>PHP>>正文


PHP CLog::WriteLog方法代码示例

本文整理汇总了PHP中CLog::WriteLog方法的典型用法代码示例。如果您正苦于以下问题:PHP CLog::WriteLog方法的具体用法?PHP CLog::WriteLog怎么用?PHP CLog::WriteLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLog的用法示例。


在下文中一共展示了CLog::WriteLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: movePatient

 public function movePatient($projectid, $patientid, $doctorid_new, $doctorid_old)
 {
     $logfile = 'MProject';
     if (empty($patientid)) {
         CLog::WriteLog(array('msg' => 'patientid不合法', 'patientid' => $patientid), $logfile);
         return false;
     }
     $project = $this->getProject($projectid);
     if (!$project) {
         CLog::WriteLog(array('msg' => '项目不存在', 'projectid' => $projectid), $logfile);
         return false;
     }
     $MUser = $this->LoadApiModelMedical('user');
     // print_r($patientArr);
     $patient = $MUser->getUser($patientid, array('role' => -10));
     // var_dump($patient);
     if (empty($patient)) {
         CLog::WriteLog(array('msg' => '病人不存在', 'patientid' => $patientid), $logfile);
         return false;
     }
     $doctor = $MUser->getUser($doctorid_new, array('role' => 10));
     if (empty($doctor)) {
         CLog::WriteLog(array('msg' => 'doctorid_new不存在', 'doctorid_new' => $doctorid_new), $logfile);
         return false;
     }
     $doctor_old = $MUser->getUser($doctorid_old, array('role' => 10));
     if (empty($doctor_old)) {
         CLog::WriteLog(array('msg' => 'doctorid_old不存在', 'doctorid_old' => $doctorid_old), $logfile);
         return false;
     }
     // var_dump($doctorid_old);
     //准备要修改的病人记录(多条)
     $upArr = array('doctorid' => $doctorid_new);
     CLog::WriteLog(array('msg' => '执行updateData', 'upArr' => $upArr), $logfile);
     $ok = $this->updateData($this->tPPatient, $upArr, array('projectid' => $projectid, 'patientid' => $patientid));
     if (!$ok) {
         return false;
     }
     //获取项目下病人的个数(项目下的不用更新)
     /*$num_patient = $this->getCount($this->tPPatient, array('projectid'=>$projectid));
       if($num_patient > 0){
           $this->updateProject($projectid, array('num_patient'=>$num_patient));
       }*/
     //end 获取项目下病人的个数
     //获取医生下的病人数,包括新、旧
     //新
     $num_patient = $this->getCount($this->tPPatient, array('projectid' => $projectid, 'doctorid' => $doctorid_new));
     $this->updateData($this->tPDoctor, array('num_patient' => $num_patient), array('projectid' => $projectid, 'doctorid' => $doctorid_new));
     //旧
     $num_patient = $this->getCount($this->tPPatient, array('projectid' => $projectid, 'doctorid' => $doctorid_old));
     $this->updateData($this->tPDoctor, array('num_patient' => $num_patient), array('projectid' => $projectid, 'doctorid' => $doctorid_old));
     //end 获取医生的个数
     //获取医院下(pi)的病人数,包括新、旧
     //新
     $num_patient = $this->getCount($this->tPPatient, array('projectid' => $projectid, 'hospitalid' => $doctor['hospitalid']));
     $this->updateData($this->tPPi, array('num_patient' => $num_patient), array('projectid' => $projectid, 'hospitalid' => $doctor['hospitalid']));
     //旧
     $num_patient = $this->getCount($this->tPPatient, array('projectid' => $projectid, 'hospitalid' => $doctor_old['hospitalid']));
     $this->updateData($this->tPPi, array('num_patient' => $num_patient), array('projectid' => $projectid, 'hospitalid' => $doctor_old['hospitalid']));
     //end 获取医院下(pi)的病人数
     return true;
 }
开发者ID:MedicalProjectto,项目名称:medical,代码行数:62,代码来源:MProject.php

示例2: updateUser

 public function updateUser($userid, $postArr)
 {
     $logfile = 'updateUser';
     $retArr = array('status' => 0, 'message' => '', 'user' => null);
     CLog::WriteLog(array('msg' => '所有参数', 'userid' => $userid, 'postArr' => $postArr), $logfile);
     //数据检查
     if (empty($postArr) || !$userid) {
         $retArr['message'] = '数据不合法';
         return $retArr;
     }
     $old = $this->getuser($userid);
     if (!$old) {
         $retArr['message'] = '员工不存在!';
         return $retArr;
     }
     if (!empty($postArr['mobile'])) {
         $old = $this->getuser(null, array('mobile' => $postArr['mobile']));
         if ($old) {
             $retArr['message'] = '该手机已存在';
             return $retArr;
         }
     }
     //end 数据检查
     $this->_trim_update_data($postArr);
     //整理数据
     $ok = $this->updateData($this->user, $postArr, $userid);
     if (false !== $ok) {
         if ($this->getAtom($this->tProfile, array('userid' => $userid))) {
             $this->updateData($this->tProfile, $postArr, array('userid' => $userid));
         } else {
             $postArr['userid'] = $userid;
             $this->addAtom($this->tProfile, $postArr);
         }
         $retArr['message'] = '修改成功';
         $retArr['status'] = 1;
     } else {
         $retArr['message'] = '修改失败';
     }
     return $retArr;
 }
开发者ID:MedicalProjectto,项目名称:medical,代码行数:40,代码来源:MUser.php

示例3: saveTplReport


//.........这里部分代码省略.........
                 // if($freqs > 1) return;  //如果是多次就返回,因为不知道更新哪条好(也可以更新最后一条)
                 $reportid = $old['id'];
                 //最近一周期已经填写过了就不能再添加了,赋值reportid是为了接下来作更新操作
             }
             /*
                             switch($period){
                                 case 0:
                                     $reportid = $old['id'];
                                     break; //一次性的就不能再添加了
                                 case -1:
                                     if(CTime::IsToday($utime) && $cnteds>=$freqs){//是今天
                                         $reportid = $old['id'];
                                     }
                                     break;
                                 case -7:
                                     if(CTime::IsWeek($utime)){//是本周
                                         $reportid = $old['id'];
                                     }
                                     break;
                                 case -30:
                                     if(CTime::IsMonth($utime)){//是本月
                                         $reportid = $old['id'];
                                     }
                                     break;
                                 case -365:
                                     if(CTime::IsYear($utime)){//是当年
                                         $reportid = $old['id'];
                                     }
                                     break;
                             }*/
         }
     }
     //end 业务上的数据检查
     CLog::WriteLog(array('msg' => 'commit数据', 'reportid' => $reportid, 'periodid' => $periodid, 'postArr' => $postArr, 'details' => $details), $logfile);
     if ($reportid) {
         $ok = $this->updateData($this->tReport, $postArr, $reportid);
     } else {
         $postArr['ctime'] = $postArr['utime'];
         $ok = $reportid = $this->addAtom($this->tReport, $postArr);
     }
     if (CUtil::NoFalse($ok)) {
         $report = $this->getTplReport($reportid, null, array('aggregated' => true));
         //更新报告值=====================================
         if ($details) {
             $valueArr = CUtil::formArrayFormatting($details, 0);
             CLog::WriteLog(array('msg' => 'commit值', 'valueArr' => $valueArr), $logfile);
             $tpl_did_arr = $this->getArrayColumn($valueArr, 'detailid');
             $detailArr = $this->getData($this->tTdetail, array('id in' => $tpl_did_arr), array('limit' => count($tpl_did_arr), 'keyas' => 'id'));
             $termid_arr = $this->getArrayColumn($detailArr, 'termid');
             $MTerm = $this->LoadApiModelMedical('term');
             $termArr = $MTerm->getTerms($termid_arr, null, array('limit' => count($termid_arr), 'only_data' => true, 'keyas' => 'id', 'fields' => '^ctime,utime'));
             // print_r($termArr);
             foreach ($valueArr as $k => &$r0005) {
                 if (empty($r0005['detailid'])) {
                     unset($valueArr[$k]);
                     continue;
                 }
                 //检查detailid在数据库中是否存在,不存在则删除
                 if (!isset($detailArr[$r0005['detailid']])) {
                     unset($valueArr[$k]);
                     continue;
                 }
                 //检查指标是否在指标库中存在,存在则将termid及输入类型存放tpl_report_detail中
                 $detail = $detailArr[$r0005['detailid']];
                 if (isset($termArr[$detail['termid']])) {
                     $term = $termArr[$detail['termid']];
开发者ID:MedicalProjectto,项目名称:medical,代码行数:67,代码来源:MTpl.php

示例4: actionNotify

 function actionNotify()
 {
     $pay = new WxPay();
     $logs = array();
     $wxinfoArr = $pay->NotifyInterface();
     $logs['wxinfoxml'] = $wxinfoArr['xml'];
     //log
     $wxinfo = json_decode(json_encode(simplexml_load_string($wxinfoArr['xml'], 'SimpleXMLElement', LIBXML_NOCDATA)), true);
     if (1 == intval($wxinfoArr['state'])) {
         //成功
         $tradeno = $wxinfo['out_trade_no'];
         $logs['addPay-data'] = $wxinfo;
         $logs['tradeno'] = $tradeno;
         $this->processByTradeno($tradeno, $wxinfo);
     }
     CLog::WriteLog($logs, 'wx-pay');
 }
开发者ID:MedicalProjectto,项目名称:medical,代码行数:17,代码来源:KWxpay.php


注:本文中的CLog::WriteLog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。