From 89c2b99ab9f7b162b9ce6f42077dbf8692066879 Mon Sep 17 00:00:00 2001 From: zm <zm@iemsoft.cn> Date: Mon, 14 Sep 2020 13:11:17 +0800 Subject: [PATCH] 按知识点搜索 移动端 开发完成 --- we254/addons/fy_lessonv2/inc/mobile/search.php | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/we254/addons/fy_lessonv2/inc/mobile/search.php b/we254/addons/fy_lessonv2/inc/mobile/search.php index 6594cf0..9e648d5 100644 --- a/we254/addons/fy_lessonv2/inc/mobile/search.php +++ b/we254/addons/fy_lessonv2/inc/mobile/search.php @@ -33,10 +33,15 @@ foreach ($categorylist as $k => $v) { $categorylist[$k]['child'] = pdo_fetchall("SELECT * FROM " . tablename($this -> table_category) . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>$v['id'],':search_show'=>1)); } - + /* 知识点分类 */ -$hot_knowledge = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND is_hot=:is_hot AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid' => $uniacid, ':is_hot' => 1,':search_show'=>1)); -$knowledgelist = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>0,':search_show'=>1)); +if($_GPC['cat_id'] > 0){ + $hot_knowledge = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND is_hot=:is_hot AND search_show=:search_show AND catalog_id_2=:catalog_id_2 ORDER BY displayorder DESC", array(':uniacid' => $uniacid, ':is_hot' => 1,':search_show'=>1,'catalog_id_2'=>$_GPC['cat_id'])); + $knowledgelist = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show AND catalog_id_2=:catalog_id_2 ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>0,':search_show'=>1,'catalog_id_2'=>$_GPC['cat_id'])); +}else{ + $hot_knowledge = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND is_hot=:is_hot AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid' => $uniacid, ':is_hot' => 1,':search_show'=>1)); + $knowledgelist = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>0,':search_show'=>1)); +} foreach ($knowledgelist as $k => $v) { $knowledgelist[$k]['child'] = pdo_fetchall("SELECT * FROM " . tablename("fy_lesson_knowledge_point") . " WHERE uniacid=:uniacid AND parentid=:parentid AND search_show=:search_show ORDER BY displayorder DESC", array(':uniacid'=>$uniacid, ':parentid'=>$v['id'],':search_show'=>1)); -- Gitblit v1.8.0