當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。