推動101

最新貼文
參觀人氣
本日人氣: 70
累積人氣: 120,092
分享 推播通知
目前身份: 訪客
$wh = [];
$wh[] = "(1=1)";
if (!empty($params['q'])) $wh[] = "(keyword_name = '".escapeString($params['q'])."')";
if (!empty($params['pr_start'])) $wh[] = "(bg_cond_start_price >= ".intval($params['pr_start']).")";
if (!empty($params['pr_end'])) $wh[] = "(bg_cond_end_price <= ".intval($params['pr_start']).")";

$arr_q_in_txt = explode(" ", $params['q_in_txt']);
$arr_q_ex_txt = explode(" ", $params['q_ex_txt']);

$q_in_txt_condition = implode(" AND ", array_map(function($day) {
	return "JSON_CONTAINS(bg_cond_include_key, '\"$day\"')";
}, $arr_q_in_txt));

$q_ex_txt_condition = implode(" AND ", array_map(function($day) {
	return "JSON_CONTAINS(bg_cond_exclude_key, '\"$day\"')";
}, $arr_q_ex_txt));

if (!empty($params['q_in_txt'])) $wh[] = " ($q_in_txt_condition)";
if (!empty($params['q_ex_txt'])) $wh[] = " ($q_ex_txt_condition)";
$where = implode(" AND ", $wh);

$sql = "SELECT *
		FROM ".self::$table_name."
		WHERE $where";
echo $sql;exit;
人氣 1076
推動101 發表在 留言 (0) 人氣 (1076)
分享給朋友
網址

想對外分享這則貼文嗎?運用網址更方便呦~

載入中...