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'; //设置返回数据集的对象名