在使用PbootCms的过程中,需要用到Ajax搜索,就需要调用API接口中的search。在实际使用过程中出现了BUG,API接口并未返回正确有效的信息。
这个问题出现在ajax的post参数中,传入了num参数,而接口中的$where3变量中并未对num参数进行unset,导致$where3变量中多出了一个num值,导致SQL异常。
在apps\api\controller\CmsController.php文件的大约330行,加入unset($where3['num']);
// 去除特殊键值 unset($where3['appid']); unset($where3['timestamp']); unset($where3['signature']); unset($where3['keyword']); unset($where3['field']); unset($where3['scode']); unset($where3['page']); unset($where3['from']); unset($where3['isappinstalled']); unset($where3['tdsourcetag']); unset($where3['x']); unset($where3['y']); unset($where3['searchtpl']); unset($where3['p']); unset($where3['s']); unset($where3['num']);
到此BUG修复。
文章评论(审核通过可见)