本文整理匯總了PHP中XString::jsArrayIsEmpty方法的典型用法代碼示例。如果您正苦於以下問題:PHP XString::jsArrayIsEmpty方法的具體用法?PHP XString::jsArrayIsEmpty怎麽用?PHP XString::jsArrayIsEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XString
的用法示例。
在下文中一共展示了XString::jsArrayIsEmpty方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ajaxgetdata4chart
public function ajaxgetdata4chart($request, $response)
{/*{{{*/
DBC::requireNotEmptyString($request->categorykey, 'categoryKey不可為空');
$lastTime = XDateTime::valueOf($request->lasttime);
$response->lastTime = $lastTime;
$startTime = $lastTime->addDay(-30);
$response->startTime = $startTime;
$response->centerTitle = '';
switch ($request->categorykey)
{/*{{{*/
case HealthRecordProblem::CHART_BLOODPRESSURE:
$response->bloodJsonDataArr = HealthRecordClient::getInstance()->getBloodJsonData4StateSummaryChart($request->userid, $startTime->toShortString(), $lastTime->toShortString());
$high = isset($response->bloodJsonDataArr['high']) ? $response->bloodJsonDataArr['high'] : 0;
$low = isset($response->bloodJsonDataArr['low']) ? $response->bloodJsonDataArr['low'] : 0;
if(XString::jsArrayIsEmpty($high) && XString::jsArrayIsEmpty($low))
{
$response->centerTitle = '這30天沒有血壓記錄';
}
break;
case HealthRecordProblem::CHART_HEARTRATE:
$response->heartRateJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::HEARTRATE_TITLE, $startTime, $lastTime);
if(XString::jsArrayIsEmpty($response->heartRateJson))
{
$response->centerTitle = '這30天沒有心率記錄';
}
break;
case HealthRecordProblem::CHART_WEIGHT:
$response->weightJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::WEIGHT_TITLE, $startTime, $lastTime);
if(XString::jsArrayIsEmpty($response->weightJson))
{
$response->centerTitle = '這30天沒有體重記錄';
}
break;
case HealthRecordProblem::CHART_SHITSINGLE:
$response->pinkShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::PINKSHIT_TITLE, $startTime, $lastTime);
$response->blackShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::BLACKSHIT_TITLE, $startTime, $lastTime);
$response->yellowShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::YELLOWSHIT_TITLE, $startTime, $lastTime);
$response->redShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::REDSHIT_TITLE, $startTime, $lastTime);
$response->whiteShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::WHITESHIT_TITLE, $startTime, $lastTime);
if(XString::jsArrayIsEmpty($response->pinkShitJson) &&
XString::jsArrayIsEmpty($response->blackShitJson) &&
XString::jsArrayIsEmpty($response->yellowShitJson) &&
XString::jsArrayIsEmpty($response->redShitJson) &&
XString::jsArrayIsEmpty($response->whiteShitJson)
)
{
$response->centerTitle = '這30天沒有大便記錄';
}
break;
case HealthRecordProblem::CHART_SHITTOTAL:
$response->totalShitJson = HealthRecordClient::getInstance()->getShitTatalJsonData($request->userid, $startTime, $lastTime);
$response->shitJsonHashData = HealthRecordClient::getInstance()->getShitJsonHashData($request->userid, $startTime, $lastTime);
if(XString::jsArrayIsEmpty($response->totalShitJson))
{
$response->centerTitle = '這30天沒有大便記錄';
}
break;
case HealthRecordProblem::CHART_CDAI:
$startTime = $lastTime->addYear(-1);
$response->startTime = $startTime;
$response->cdaiJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::CDAI_TITLE, $startTime, $lastTime);
if(XString::jsArrayIsEmpty($response->cdaiJson))
{
$response->centerTitle = '這一年沒有CDAI記錄';
}
break;
}/*}}}*/
return $request->categorykey;
}/*}}}*/