迅睿開(kāi)源框架是一款PHP8高性能·簡(jiǎn)單易用的PHP開(kāi)源開(kāi)發(fā)框架, 基于MIT開(kāi)源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
欄目列表頁(yè)的文章排序,如何可以先排序 推薦的文章,然后再排序普通發(fā)布的文章
用什么樣的方法比較簡(jiǎn)單的實(shí)現(xiàn)這個(gè)功能
則個(gè)有點(diǎn)復(fù)雜了,我研究研究
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
<?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?>
然后module標(biāo)簽排序order改成:
order=$order
不知道可不可以,成與不成都回復(fù)一下
回復(fù)@迅??蚣苈?lián)合創(chuàng)始人
{module catid=$catid order=$order} <?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?> <li class="imgscale"> <a class="relative" href="{$t.url}"> <div class="img100"> <img src="{dr_thumb($t['thumb'], 300, 216, 0, 'crop')}"/> </div> <div class="xw-con"> <div class="table"> <div class="table-cell"> <div class="xw-txt"> <h4><div style="display:block; word-break: keep-all; white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$t.title}</div></h4> <span>{$t['updatetime']}</span> <p> {dr_strcut($t['description'], 180, '...')} </p> </div> </div> </div> </div> </a> </li>{/module}
怎么寫(xiě)?不會(huì)啊
<?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?> {module catid=$catid order=$order} <li class="imgscale"> <a class="relative" href="{$t.url}"> <div class="img100"> <img src="{dr_thumb($t['thumb'], 300, 216, 0, 'crop')}"/> </div> <div class="xw-con"> <div class="table"> <div class="table-cell"> <div class="xw-txt"> <h4><div style="display:block; word-break: keep-all; white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$t.title}</div></h4> <span>{$t['updatetime']}</span> <p> {dr_strcut($t['description'], 180, '...')} </p> </div> </div> </div> </div> </a> </li>{/module}
則個(gè)有點(diǎn)復(fù)雜了,我研究研究
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
<?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?>然后module標(biāo)簽排序order改成:
不知道可不可以,成與不成都回復(fù)一下
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@迅??蚣苈?lián)合創(chuàng)始人
{module catid=$catid order=$order} <?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?> <li class="imgscale"> <a class="relative" href="{$t.url}"> <div class="img100"> <img src="{dr_thumb($t['thumb'], 300, 216, 0, 'crop')}"/> </div> <div class="xw-con"> <div class="table"> <div class="table-cell"> <div class="xw-txt"> <h4><div style="display:block; word-break: keep-all; white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$t.title}</div></h4> <span>{$t['updatetime']}</span> <p> {dr_strcut($t['description'], 180, '...')} </p> </div> </div> </div> </div> </a> </li>{/module}怎么寫(xiě)?不會(huì)啊
<?php $flag='';$table=MOD_DIR.'_flag';?> {table table_site=$table} <?php $t['id'] && $flag.=' WHEN '.$t['id'].' THEN '.($key+1);?> {/table} <?php // 先查詢推薦位的內(nèi)容,然后加入到自定義排序中然他們靠前面 $flag && $order = urlencode(" CASE `id` ".$flag." ELSE 99 END,updatetime desc"); ?> {module catid=$catid order=$order} <li class="imgscale"> <a class="relative" href="{$t.url}"> <div class="img100"> <img src="{dr_thumb($t['thumb'], 300, 216, 0, 'crop')}"/> </div> <div class="xw-con"> <div class="table"> <div class="table-cell"> <div class="xw-txt"> <h4><div style="display:block; word-break: keep-all; white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$t.title}</div></h4> <span>{$t['updatetime']}</span> <p> {dr_strcut($t['description'], 180, '...')} </p> </div> </div> </div> </div> </a> </li>{/module}開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!