嘿,我有一个问题,这是我的代码,如果我使用从$获得的所有参数,那么它的启动速度会很慢。。。。。(大约5分钟)。
$checkbox = array(
\'immediate\'=>\'כניסה מידית\',
\'air\'=>\'מיזוג\',
\'furniture\'=>\'ריהוט\',
\'renovated\'=>\'משופץ\',
\'elevator\'=>\'מעלית\',
\'parking\'=>\'חניה\'
);
if($_GET[\'mainCat\']>0){$cat = array(array(\'taxonomy\' => \'category-board\', \'field\' => \'term_id\',\'terms\' => $_GET[\'mainCat\']));}
if($_GET[\'fromNumberOfRooms\']>0){$fromNumberOfRooms = array(\'key\' => \'number-of-rooms\',\'value\' => $_GET[\'fromNumberOfRooms\'],\'compare\' => \'>=\', \'type\' => \'NUMERIC\');}
if($_GET[\'upToNumberOfRooms\']>0){$upToNumberOfRooms = array(\'key\' => \'number-of-rooms\',\'value\' => $_GET[\'upToNumberOfRooms\'],\'compare\' => \'>=\', \'type\' => \'NUMERIC\');}
if($_GET[\'fromSize\']>0){$fromSize = array(\'key\' => \'size\',\'value\' => $_GET[\'fromSize\'],\'compare\' => \'>=\', \'type\' => \'NUMERIC\');}
if($_GET[\'upToSize\']>0){$upToSize = array(\'key\' => \'size\',\'value\' => $_GET[\'upToSize\'],\'compare\' => \'<=\', \'type\' => \'NUMERIC\');}
if($_GET[\'fromPrice\']>0){$fromPrice = array(\'key\' => \'price\',\'value\' => $_GET[\'fromPrice\'],\'compare\' => \'>=\', \'type\' => \'NUMERIC\');}
if($_GET[\'upToPrice\']>0){$upToPrice = array(\'key\' => \'price\',\'value\' => $_GET[\'upToPrice\'],\'compare\' => \'<=\', \'type\' => \'NUMERIC\');}
foreach($checkbox as $key=>$val) {
if ($_GET[$key] >= 1) {
$$key = array(\'key\' => $key, \'value\' => $_GET[$key], \'compare\' => \'>=\', \'type\' => \'NUMERIC\');
}
}
*/
$args = array(
\'post_type\' => \'board\', \'tax_query\' => $cat,
\'meta_query\' => array($fromPrice, $upToPrice, $fromSize, $upToSize, $fromNumberOfRooms, $upToNumberOfRooms, $immediate, $air, $furniture, $renovated, $elevator, $parking)
);
query_posts( $args );