本文整理汇总了PHP中CUtil::NoFalse方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::NoFalse方法的具体用法?PHP CUtil::NoFalse怎么用?PHP CUtil::NoFalse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtil
的用法示例。
在下文中一共展示了CUtil::NoFalse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateProject
public function updateProject($projectid, $postArr, $piArr = array(), $doctorArr = array(), $patientArr = array(), $tplArr = array())
{
$retArr = array('status' => 0, 'message' => '', 'project' => null);
$postArr = $this->removeArrayNull($postArr);
//数据检查=====================================
if (empty($postArr) || !$projectid) {
$retArr['message'] = '数据不合法';
return $retArr;
}
$old = $this->getProject($projectid);
if (!$old) {
$retArr['message'] = '项目不存在';
return $retArr;
}
$postArr['utime'] = date("Y-m-d H:i:s");
if (!empty($postArr['name'])) {
$oldt = $this->getProject(null, array('hospitalid' => $old['hospitalid'], 'name' => $postArr['name']));
if ($oldt) {
$this->appendPI($old['id'], $piArr);
$this->appendDoctor($old['id'], $old['userid'], $doctorArr);
$this->appendPatient($old['id'], $old['userid'], $patientArr);
$this->appendTpl($old['id'], $tplArr);
$retArr['project'] = $old;
$retArr['message'] = '项目名称不可用';
return $retArr;
}
}
//数据检查==================================end
$ok = $this->updateData($this->tProject, $postArr, $projectid);
if (CUtil::NoFalse($ok)) {
$this->appendPI($old['id'], $piArr);
$this->appendDoctor($old['id'], $old['userid'], $doctorArr);
$this->appendPatient($old['id'], $old['userid'], $patientArr);
$this->appendTpl($old['id'], $tplArr);
$project = $this->getProject($projectid);
$retArr['project'] = $project;
$retArr['status'] = 1;
$retArr['message'] = '更新成功';
} else {
$retArr['message'] = '系统繁忙,请稍后再试';
}
return $retArr;
}
示例2: saveTplReport
//.........这里部分代码省略.........
$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']];
$r0005['termid'] = $term['id'];
$r0005['itype'] = $term['itype'];
$r0005['vtype'] = $term['vtype'];
}
$r0005 = $this->removeArrayNull($r0005);
}
if (!empty($valueArr)) {