迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統(tǒng)。
業(yè)務經理
微信掃描以上二維碼
028-61286886
技術咨詢
這種調用方式在迅睿cms里面可以實現(xiàn)嗎?因為list 標簽很強大可以寫很多自定義字段和修飾符
迅睿的數(shù)據(jù)接口不知道怎么添加修飾符
求指教
不能
回復@利中 迅睿cms 數(shù)據(jù)接口能添加修飾符嗎?
不能加修飾符,提意見讓增加吧
估計不行。
前臺調用
修改文件 dayrui/App/Httpapi/Controllers/Home.php
添加
/**
* 通過標簽調用數(shù)據(jù)
*/
public function my_index() {
$this->_api_auth();
$list = \Phpcmf\Service::L('input')->get('param'); //標簽
$call = \Phpcmf\Service::L('input')->get('api_call_function'); //回調函數(shù)
$data = array('type' =>3 , 'call' => $call, 'list' => $list );
$rt = \Phpcmf\Service::M('http', APP_DIR)->get_api_data($data);
$this->_json($rt['code'], $rt['msg'], $rt['data']);
exit;
}
分頁怎么寫的 用page無用 大佬
回復@SMALL http://m.apdwn.com/v3doc/157.html 參考這個
回復@胡銀萍 我發(fā)現(xiàn)不能通過鑒權了,又自己改了下
//$this->_api_auth(); $signature = \Phpcmf\Service::L('input')->get('signature'); //簽名 $timestamp = \Phpcmf\Service::L('input')->get('timestamp'); //時間 $appid = \Phpcmf\Service::L('input')->get('appid'); //appid $appsecret = "PHPCMF3EAC5A0D6FB63"; if($signature!= md5($appid.$appsecret.$timestamp)){ $this->_json(0, '簽名錯誤'); } $page = max(1,(int)\Phpcmf\Service::L('input')->get('page')); //$page; $pagesize = max(10,(int)\Phpcmf\Service::L('input')->get('pagesize')); //pagesize; $order = \Phpcmf\Service::L('input')->get('order'); //appid; $order = in_array($order,['hist','inputtime'])?$order:'hist'; $num = $pagesize*($page-1).",".$pagesize;
不能
回復@利中 迅睿cms 數(shù)據(jù)接口能添加修飾符嗎?
不能加修飾符,提意見讓增加吧
估計不行。
前臺調用
修改文件 dayrui/App/Httpapi/Controllers/Home.php
添加
/**
* 通過標簽調用數(shù)據(jù)
*/
public function my_index() {
$this->_api_auth();
$list = \Phpcmf\Service::L('input')->get('param'); //標簽
$call = \Phpcmf\Service::L('input')->get('api_call_function'); //回調函數(shù)
$data = array('type' =>3 , 'call' => $call, 'list' => $list );
$rt = \Phpcmf\Service::M('http', APP_DIR)->get_api_data($data);
$this->_json($rt['code'], $rt['msg'], $rt['data']);
exit;
}
分頁怎么寫的 用page無用 大佬
回復@SMALL http://m.apdwn.com/v3doc/157.html 參考這個
回復@胡銀萍 我發(fā)現(xiàn)不能通過鑒權了,又自己改了下
//$this->_api_auth(); $signature = \Phpcmf\Service::L('input')->get('signature'); //簽名 $timestamp = \Phpcmf\Service::L('input')->get('timestamp'); //時間 $appid = \Phpcmf\Service::L('input')->get('appid'); //appid $appsecret = "PHPCMF3EAC5A0D6FB63"; if($signature!= md5($appid.$appsecret.$timestamp)){ $this->_json(0, '簽名錯誤'); } $page = max(1,(int)\Phpcmf\Service::L('input')->get('page')); //$page; $pagesize = max(10,(int)\Phpcmf\Service::L('input')->get('pagesize')); //pagesize; $order = \Phpcmf\Service::L('input')->get('order'); //appid; $order = in_array($order,['hist','inputtime'])?$order:'hist'; $num = $pagesize*($page-1).",".$pagesize;