聯(lián)系官方銷售客服
1835022288
028-61286886
欄目模型單選字段如何加入到接口自定義搜索參數(shù)
想要進(jìn)一步篩選出states=6的文章
https://www.abc.com/index.php?appid=1&appsecret=PHPCMF21XXXXXXX&s=news&c=search&api_call_function=module_search_news_list&states=6
states字段:news模塊--欄目模型字段--類型:Radio--主表
API接口數(shù)據(jù)為自定義模板代碼
{module module=news more=1}
{api::id=$t.id}
{api::catid=$t.catid}
{api::title=$t.title}
{api::thumb=$t.thumb}
{api::states=$t.states}
{api::updatetime=$t.updatetime}
{api::hits=$t.hits}
{api::comments=$t.comments}
{api::url=$t.url}
{/module}
插件版權(quán):官方插件
插件名稱:httpapi
官方提醒:使用module內(nèi)容循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
也許,假設(shè)接口模板里直接這樣寫:{module module=news states=6 more=1}就能實(shí)現(xiàn)。
但是只滿足一個(gè)選項(xiàng)。
如果單選字段states有幾十個(gè)選項(xiàng),那就得新建幾十次接口了。折磨人。
回復(fù)@豬肉販子 你可以借鑒一下思路
雖然樓上舉例了很多,無奈我能力不到,無從下手。
后臺(tái)API接口數(shù)據(jù)自定義模板代碼:假設(shè)這樣寫能約定輸出states=6的列表。
{module module=news states=6 more=1}
前端調(diào)用地址為:index.php?s=httpapi&id=2&appid=需要填寫值&appsecret=需要填寫值.
========================
現(xiàn)在問題是,states這個(gè)單選字段有若干個(gè)選項(xiàng),有沒有相對(duì)簡(jiǎn)單靈活的方法,最終實(shí)現(xiàn)前端這樣調(diào)用:
index.php?s=httpapi&id=2&appid=需要填寫值&appsecret=需要填寫值&states=xxx
這個(gè)能看懂嗎?
這里加一個(gè)函數(shù)
返回格式處理函數(shù)在這里
回復(fù)@胡銀萍 function load_more_data (catid) {var url是寫到哪個(gè)文件內(nèi)呢?
專業(yè)寫接口,QQ遠(yuǎn)程幫你搞定
回復(fù)@豬肉販子 這個(gè)函數(shù)就是觸發(fā)列表標(biāo)簽。你是一點(diǎn)不會(huì),還是會(huì)些