zm
2020-09-27 01e1c2036989ad81e8df2a108615ee95c26a3292
PC端知识点搜索开发完成
2 files modified
83 ■■■■ changed files
we254/addons/fy_lessonv2/inc/webapp/Search.php 17 ●●●●● patch | view | raw | blame | history
we254/addons/fy_lessonv2/template/webapp/default/search.html 66 ●●●● patch | view | raw | blame | history
we254/addons/fy_lessonv2/inc/webapp/Search.php
@@ -19,6 +19,8 @@
$keyword       = trim($_GPC['keyword']);
$pid           = trim($_GPC['pid']);
$cid           = trim($_GPC['cid']);
$kid_p           = trim($_GPC['kid_p']);
$kid           = trim($_GPC['kid']);
$lesson_type   = trim($_GPC['lesson_type']);
$lesson_nature = trim($_GPC['lesson_nature']);
$sort           = trim($_GPC['sort']);
@@ -31,6 +33,13 @@
    $child = pdo_fetchall("SELECT id,name FROM " .tablename($this->table_category). " WHERE uniacid=:uniacid AND parentid=:parentid ORDER BY displayorder DESC, id ASC", array(':uniacid'=>$uniacid, ':parentid'=>$pid));
}
if($cid){
    $know_parent = pdo_fetchall("SELECT id,name FROM ims_fy_lesson_knowledge_point WHERE uniacid=:uniacid AND parentid=0 AND catalog_id_1=:catalog_id_1 AND catalog_id_2=:catalog_id_2 ORDER BY displayorder DESC, id ASC", array(':uniacid'=>$uniacid, ':catalog_id_1'=>$pid, ':catalog_id_2'=>$cid));
}
if($kid_p){
    $know = pdo_fetchall("SELECT id,name FROM ims_fy_lesson_knowledge_point WHERE uniacid=:uniacid AND parentid=:parentid AND catalog_id_1=:catalog_id_1 AND catalog_id_2=:catalog_id_2 ORDER BY displayorder DESC, id ASC", array(':uniacid'=>$uniacid, ':parentid'=>$kid_p, ':catalog_id_1'=>$pid, ':catalog_id_2'=>$cid));
}
$condition = " a.uniacid=:uniacid AND a.status=:status";
$params = array(
    ':uniacid' => $uniacid,
@@ -49,6 +58,14 @@
    $condition .= " AND a.cid=:cid";
    $params[':cid'] = $cid;
}
if($kid_p){
    $condition .= " AND FIND_IN_SET(:kid_p,a.knowledge_pid)";
    $params[':kid_p'] = $kid_p;
}
if($kid){
    $condition .= " AND FIND_IN_SET(:kid,a.knowledge_id)";
    $params[':kid'] = $kid;
}
if($lesson_type!=''){
    $condition .= " AND a.lesson_type=:lesson_type";
    $params[':lesson_type'] = $lesson_type;
we254/addons/fy_lessonv2/template/webapp/default/search.html
@@ -41,16 +41,52 @@
                <div class="w-all fl hg-1 bg-c-d2d2d2"></div>
                {/if}
                {if $_GPC['cid']}
                <div class="w-all p-t-10 p-b-10 ovhidden">
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">专题</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['kid_p']}class_cur{/if}">不限</a>
                        </li>
                        {loop $know_parent $item}
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$item['id']}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['kid_p']==$item['id']}class_cur{/if}">{$item['name']}</a>
                        </li>
                        {/loop}
                        <div class="clear"></div>
                    </ul>
                </div>
                <div class="w-all fl hg-1 bg-c-d2d2d2"></div>
                {/if}
                {if $_GPC['kid_p']}
                <div class="w-all p-t-10 p-b-10 ovhidden">
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">知识点</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['kid']}class_cur{/if}">不限</a>
                        </li>
                        {loop $know $item}
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$item['id']}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['kid']==$item['id']}class_cur{/if}">{$item['name']}</a>
                        </li>
                        {/loop}
                        <div class="clear"></div>
                    </ul>
                </div>
                <div class="w-all fl hg-1 bg-c-d2d2d2"></div>
                {/if}
                {if $lesson_attribute['attribute1']}
                <div class="w-all p-t-10 p-b-10 ovhidden">
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">{$lesson_attribute['attribute1']}</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['attr1']}class_cur{/if}">不限</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['attr1']}class_cur{/if}">不限</a>
                        </li>
                        {loop $attribute1 $item}
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$item['id']}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['attr1']==$item['id']}class_cur{/if}">{$item['name']}</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$item['id']}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['attr1']==$item['id']}class_cur{/if}">{$item['name']}</a>
                        </li>
                        {/loop}
                        <div class="clear"></div>
@@ -64,11 +100,11 @@
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">{$lesson_attribute['attribute2']}</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['attr2']}class_cur{/if}">不限</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['attr2']}class_cur{/if}">不限</a>
                        </li>
                        {loop $attribute2 $item}
                        <li class="w-min80 w-max120 ovhidden m-l-24 p-b-3 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$item['id']}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['attr2']==$item['id']}class_cur{/if}">{$item['name']}</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$item['id']}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['attr2']==$item['id']}class_cur{/if}">{$item['name']}</a>
                        </li>
                        {/loop}
                        <div class="clear"></div>
@@ -81,16 +117,16 @@
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">课程类型</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==''}class_cur{/if}">不限</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==''}class_cur{/if}">不限</a>
                        </li>
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type=0&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']=='0'}class_cur{/if}">普通课程</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type=0&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']=='0'}class_cur{/if}">普通课程</a>
                        </li>
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type=1&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==1}class_cur{/if}">报名课程</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type=1&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==1}class_cur{/if}">报名课程</a>
                        </li>
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type=3&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==3}class_cur{/if}">直播课程</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type=3&lesson_nature={$lesson_nature}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_type']==3}class_cur{/if}">直播课程</a>
                        </li>
                        <div class="clear"></div>
                    </ul>
@@ -101,13 +137,13 @@
                    <div class="w-80 fs-14 line-h28 ftc-888888 fl">课程性质</div>
                    <ul class="w-1100 fl">
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['lesson_nature']}class_cur{/if}">不限</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if !$_GPC['lesson_nature']}class_cur{/if}">不限</a>
                        </li>
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature=1&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_nature']==1}class_cur{/if}">免费课程</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature=1&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_nature']==1}class_cur{/if}">免费课程</a>
                        </li>
                        <li class="w-min80 w-max120 ovhidden m-l-24 fl">
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature=2&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_nature']==2}class_cur{/if}">付费课程</a>
                            <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature=2&sort={$sort}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="dsblock w-all fs-14 line-h28 ftc-525252 curpter text-c fl search-condition {if $_GPC['lesson_nature']==2}class_cur{/if}">付费课程</a>
                        </li>
                        <div class="clear"></div>
                    </ul>
@@ -120,16 +156,16 @@
        <div class="w-1200 bg-c-ffffff p-t-10 p-b-10 fl m-t-30">
            <dl class="ql_sort">
                <dd class="w-75 p-l-10 curpter fs-14 ftc-000000 line-h24 m-l-12 fl">
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if !$_GPC['sort']}cur{/if}">综合排序<i class="iconfont icon-default-sort"></i> </a>
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if !$_GPC['sort']}cur{/if}">综合排序<i class="iconfont icon-default-sort"></i> </a>
                </dd>
                <dd class="w-75 p-l-10 curpter fs-14 ftc-000000 line-h24 m-l-12 fl">
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=hot&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='hot'}cur{/if}">人气优先<i class="iconfont icon-sort"></i> </a>
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=hot&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='hot'}cur{/if}">人气优先<i class="iconfont icon-sort"></i> </a>
                </dd>
                <dd class="w-75 p-l-10 curpter fs-14 ftc-000000 line-h24 m-l-12 fl">
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=price&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='price'}cur{/if}">价格优先<i class="iconfont icon-sort"></i> </a>
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=price&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='price'}cur{/if}">价格优先<i class="iconfont icon-sort"></i> </a>
                </dd>
                <dd class="w-75 p-l-10 curpter fs-14 ftc-000000 line-h24 m-l-12 fl">
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=score&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='score'}cur{/if}">好评优先<i class="iconfont icon-sort"></i> </a>
                    <a href="/{$uniacid}/search.html?pid={$pid}&cid={$cid}&kid_p={$kid_p}&kid={$kid}&lesson_type={$lesson_type}&lesson_nature={$lesson_nature}&sort=score&keyword={$keyword}&attr1={$attr1}&attr2={$attr2}" class="{if $_GPC['sort']=='score'}cur{/if}">好评优先<i class="iconfont icon-sort"></i> </a>
                </dd>
                <div class="clear"></div>
            </dl>