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