迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務經(jīng)理
微信掃描以上二維碼
028-61286886
在線咨詢
比如我的產(chǎn)品類別這樣的
分類一
子類A
子類B
子類C
分類二
我需要在篩選 子類A 篩選出所有欄目為 子類A 的數(shù)據(jù),請問怎么做呢
這個需要做兩次查詢,第一次先查詢出這個欄目和同名欄目的id號,有多組id號,然后根據(jù)這個id號傳入module標簽做為條件查詢
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@官方研發(fā)技術-岳老師 出點費用 幫我寫了吧
{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}
輸出結果現(xiàn)在是所有的fos都出來了 ,我需要的只顯示一個【fos】并且點擊這個【fos】 跳轉(zhuǎn)到一個新的頁面 出來所有的分類都是fos的頁面
點擊跳轉(zhuǎn)這個就比較麻煩了吧,因為要開發(fā)一個控制器才可以。
最簡單的方法就是用tab切換,用四樓的代碼最好
已經(jīng)搞定了 我可能畫圖說出了意思,實際是要跳轉(zhuǎn)到另外一個頁面顯示
現(xiàn)在放出代碼
第一個頁面
{category module=share pid=82 return=c1}
<a href="{$c1.url}" title="{$c1.name}" class="con">{$c1.name}</a>
{/category}
第二個頁面
<?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}
再次非常感謝【小黃人】兄弟的技術支持。
這個需要做兩次查詢,第一次先查詢出這個欄目和同名欄目的id號,有多組id號,然后根據(jù)這個id號傳入module標簽做為條件查詢
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@官方研發(fā)技術-岳老師 出點費用 幫我寫了吧
{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}
輸出結果現(xiàn)在是所有的fos都出來了 ,我需要的只顯示一個【fos】并且點擊這個【fos】 跳轉(zhuǎn)到一個新的頁面 出來所有的分類都是fos的頁面
點擊跳轉(zhuǎn)這個就比較麻煩了吧,因為要開發(fā)一個控制器才可以。
最簡單的方法就是用tab切換,用四樓的代碼最好
網(wǎng)站底部做了這個功能 不合適4樓的方法
已經(jīng)搞定了 我可能畫圖說出了意思,實際是要跳轉(zhuǎn)到另外一個頁面顯示
現(xiàn)在放出代碼
第一個頁面
{category module=share pid=82 return=c1}
<a href="{$c1.url}" title="{$c1.name}" class="con">{$c1.name}</a>
{/category}
第二個頁面
<?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}
再次非常感謝【小黃人】兄弟的技術支持。