迅睿開(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ù)咨詢
比如我的產(chǎn)品類別這樣的
分類一
子類A
子類B
子類C
分類二
我需要在篩選 子類A 篩選出所有欄目為 子類A 的數(shù)據(jù),請(qǐng)問(wèn)怎么做呢
這個(gè)需要做兩次查詢,第一次先查詢出這個(gè)欄目和同名欄目的id號(hào),有多組id號(hào),然后根據(jù)這個(gè)id號(hào)傳入module標(biāo)簽做為條件查詢
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@官方研發(fā)技術(shù)-岳老師 出點(diǎn)費(fèi)用 幫我寫了吧
{php $ct = '欄目';} {table table=1_share_category name=$ct} 欄目名稱:{$t.name} 地址:{$t.url} {/table}
{php $ct = 'FOS';} {table table=1_share_category name=$ct} 欄目名稱:{$t.name} 地址:{$t.url} {/table}
{php $ct = 'FOS';}
{table table=1_share_category name=$ct}
<a href="{$t.url}" class="con">{$t.name}</a>
{/table}
輸出結(jié)果現(xiàn)在是所有的fos都出來(lái)了 ,我需要的只顯示一個(gè)【fos】并且點(diǎn)擊這個(gè)【fos】 跳轉(zhuǎn)到一個(gè)新的頁(yè)面 出來(lái)所有的分類都是fos的頁(yè)面
點(diǎn)擊跳轉(zhuǎn)這個(gè)就比較麻煩了吧,因?yàn)橐_(kāi)發(fā)一個(gè)控制器才可以。
最簡(jiǎn)單的方法就是用tab切換,用四樓的代碼最好
已經(jīng)搞定了 我可能畫圖說(shuō)出了意思,實(shí)際是要跳轉(zhuǎn)到另外一個(gè)頁(yè)面顯示
現(xiàn)在放出代碼
第一個(gè)頁(yè)面
{category module=share pid=82 return=c1}
<a href="{$c1.url}" title="{$c1.name}" class="con">{$c1.name}</a>
{/category}
第二個(gè)頁(yè)面
<?php
$idss = '';
$rt=\Phpcmf\Service::M()->table_site('share_category')->where('name',$cat.name)->getAll();
if($rt){
$ids = [];
foreach ($rt as $k => $v) {
$ids[]=$v['id'];
}
$idss = implode(',',$ids);
?>
{if $idss}
{category module=share id=$idss}
{dr_share_cat_value($t.pid,'name')}/{$t.name}
{/if}
再次非常感謝【小黃人】兄弟的技術(shù)支持。
這個(gè)需要做兩次查詢,第一次先查詢出這個(gè)欄目和同名欄目的id號(hào),有多組id號(hào),然后根據(jù)這個(gè)id號(hào)傳入module標(biāo)簽做為條件查詢
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@官方研發(fā)技術(shù)-岳老師 出點(diǎn)費(fèi)用 幫我寫了吧
{php $ct = '欄目';} {table table=1_share_category name=$ct} 欄目名稱:{$t.name} 地址:{$t.url} {/table}這個(gè)是我的需求
{php $ct = 'FOS';} {table table=1_share_category name=$ct} 欄目名稱:{$t.name} 地址:{$t.url} {/table}{php $ct = 'FOS';}
{table table=1_share_category name=$ct}
<a href="{$t.url}" class="con">{$t.name}</a>
{/table}
輸出結(jié)果現(xiàn)在是所有的fos都出來(lái)了 ,我需要的只顯示一個(gè)【fos】并且點(diǎn)擊這個(gè)【fos】 跳轉(zhuǎn)到一個(gè)新的頁(yè)面 出來(lái)所有的分類都是fos的頁(yè)面
點(diǎn)擊跳轉(zhuǎn)這個(gè)就比較麻煩了吧,因?yàn)橐_(kāi)發(fā)一個(gè)控制器才可以。
最簡(jiǎn)單的方法就是用tab切換,用四樓的代碼最好
網(wǎng)站底部做了這個(gè)功能 不合適4樓的方法
已經(jīng)搞定了 我可能畫圖說(shuō)出了意思,實(shí)際是要跳轉(zhuǎn)到另外一個(gè)頁(yè)面顯示
現(xiàn)在放出代碼
第一個(gè)頁(yè)面
{category module=share pid=82 return=c1}
<a href="{$c1.url}" title="{$c1.name}" class="con">{$c1.name}</a>
{/category}
第二個(gè)頁(yè)面
<?php
$idss = '';
$rt=\Phpcmf\Service::M()->table_site('share_category')->where('name',$cat.name)->getAll();
if($rt){
$ids = [];
foreach ($rt as $k => $v) {
$ids[]=$v['id'];
}
$idss = implode(',',$ids);
}
?>
{if $idss}
{category module=share id=$idss}
{dr_share_cat_value($t.pid,'name')}/{$t.name}
{/category}
{/if}
再次非常感謝【小黃人】兄弟的技術(shù)支持。