本文整理汇总了PHP中Zend_Filter_Input::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter_Input::__get方法的具体用法?PHP Zend_Filter_Input::__get怎么用?PHP Zend_Filter_Input::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Filter_Input
的用法示例。
在下文中一共展示了Zend_Filter_Input::__get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: montaBuscaData
public static function montaBuscaData(Zend_Filter_Input $post, $tpBuscaData, $cmpData, $cmpBD, $cmpDataFinal = null, array $arrayJoin = null)
{
$arrBusca = array();
$aux1 = $post->__get($cmpData);
$aux2 = $post->__get($tpBuscaData);
if (!empty($aux1) || $aux2 != '') {
if ($post->__get($tpBuscaData) == "igual") {
$arrBusca["{$cmpBD} >= ?"] = ConverteData($post->__get($cmpData), 13) . " 00:00:00";
$arrBusca["{$cmpBD} <= ?"] = ConverteData($post->__get($cmpData), 13) . " 23:59:59";
} elseif ($post->__get($tpBuscaData) == "maior") {
$arrBusca["{$cmpBD} >= ?"] = ConverteData($post->__get($cmpData), 13) . " 00:00:00";
} elseif ($post->__get($tpBuscaData) == "menor") {
$arrBusca["{$cmpBD} <= ?"] = ConverteData($post->__get($cmpData), 13) . " 00:00:00";
} elseif ($post->__get($tpBuscaData) == "entre") {
$arrBusca["{$cmpBD} >= ?"] = ConverteData($post->__get($cmpData), 13) . " 00:00:00";
$arrBusca["{$cmpBD} <= ?"] = ConverteData($post->__get($cmpDataFinal), 13) . " 23:59:59";
} elseif ($post->__get($tpBuscaData) == "OT") {
$arrBusca["{$cmpBD} = ?"] = date("Y-m-d", strtotime("-1 day")) . " 00:00:00";
} elseif ($post->__get($tpBuscaData) == "U7") {
$arrBusca["{$cmpBD} > ?"] = date("Y-m-d", strtotime("-7 day")) . " 00:00:00";
$arrBusca["{$cmpBD} < ?"] = date("Y-m-d") . " 23:59:59";
} elseif ($post->__get($tpBuscaData) == "SP") {
/*$arrBusca["{$cmpBD} > ?"] = date("Y-m-").(date("d")-7)." 00:00:00";
$arrBusca["{$cmpBD} < ?"] = date("Y-m-d")." 23:59:59";*/
$dia_semana = date('w');
$primeiro_dia = date('Y-m-d', strtotime("-" . $dia_semana . "day"));
$domingo = date('Y-m-d', strtotime($primeiro_dia . "-1 week"));
$sabado = date('Y-m-d', strtotime($domingo . "6 day"));
$arrBusca["{$cmpBD} >= ?"] = $domingo . " 00:00:00";
$arrBusca["{$cmpBD} <= ?"] = $sabado . " 23:59:59";
} elseif ($post->__get($tpBuscaData) == "MM") {
$arrBusca["{$cmpBD} > ?"] = date("Y-m-01") . " 00:00:00";
$arrBusca["{$cmpBD} < ?"] = date("Y-m-d") . " 23:59:59";
} elseif ($post->__get($tpBuscaData) == "UM") {
$arrBusca["{$cmpBD} >= ?"] = date("Y-m", strtotime("-1 month")) . "-01 00:00:00";
//$arrBusca["{$cmpBD} <= ?"] = date("d/m/Y", mktime(0, 0, 0, date("m", strtotime("-1 month"))+1, 0, date("Y")));
$arrBusca["{$cmpBD} <= ?"] = date("Y-m-d", mktime(0, 0, 0, date("m", strtotime("-1 month")) + 1, 0, date("Y")));
} elseif ($post->__get($tpBuscaData) == "") {
} else {
$arrBusca["{$cmpBD} > ?"] = ConverteData($post->__get($cmpData), 13) . " 00:00:00";
if ($post->__get($cmpDataFinal) != "") {
$arrBusca["{$cmpBD} < ?"] = ConverteData($post->__get($cmpDataFinal), 13) . " 23:59:59";
}
}
}
if (!empty($arrayJoin)) {
$arrBusca = array_merge($arrayJoin, $arrBusca);
}
return $arrBusca;
}