0
我有一个路由查询字符串的问题。如何在codeigniter搜索中路由查询字符串?
我正试着用codeigniter进行路由搜索。每个搜索都有一些参数,首先是输入文本字段,用于标题或描述。其次,我有类似的工具,游戏,运动......第三,平台,如IOS,WP,Android ..以及页面。
我想看到这样的路线:
/页/ 3,或
/页/ 3 /搜索/不管或
/CAT /游戏或
/猫/游戏/搜索/ battelfield或
/页/ 1/CAT /游戏/搜索/ battelfield或
/搜索/任何或类似的东西。
我使用这个代码在模型中的功能:
enter code here
function getAppBy($categ, $page, $str, $platform) {
$perpage = 16;
$offset = ($page-1)*$perpage;
$this->db->select('app.id');
$this->db->from('t_yp_app_category cat, t_yp_user_apps app');
if ($categ != "") {
$this->db->where("cat.name =", $categ);
} if ($str != "") {
$this->db->like('app.yp_title', '%' . $str . '%');
$this->db->like('app.yp_description', '%' . $str . '%');
}if ($platform != "") {
$this->db->like('app.yp_platforms', '%' . $platform . '%');
}
$this->db->limit($perpage,$offset);
$query = $this->db->get();
$result = $query->result_array();
//FIN SELECT
if (sizeof($result) > 0) {
return $result;
} else {
return false;
}
}
enter code here
谢谢。如果我没有很好地解释,让我知道
如何做的,如果它像本地主机/测试/ 5 /?LAT = 27.6799225&LNG = 85.31890150000004 +查询= A滤波器=距离 –
@Philip你能回答为克里希纳评论我有同样的问题。 –