oPIDs)->visible(['id','price','stock','name','main_img_url'])
->toArray(); 报错
解决
在模型类 model/Product.php中加入一行代码,应该就可以了。
protected $resultSetType = 'collection'; //设置返回数据集的对象名
oPIDs)->visible(['id','price','stock','name','main_img_url'])
->toArray(); 报错
解决
在模型类 model/Product.php中加入一行代码,应该就可以了。
protected $resultSetType = 'collection'; //设置返回数据集的对象名
本文标题:TP5 接口报错 Call to a member functi
本文链接:https://www.haomeiwen.com/subject/ptqlmctx.html
网友评论