throw new ThemeException();
只要使用就报错
Fatal error: Call to a member function isEmpty() on a non-ob
[1] ErrorException in Theme.php line 35
Call to a member function isEmpty() on a non-ob
* 多个id+分隔符或者将多个id序列化成json并在query中传递
*/
public function getSimpleList($ids = '')
{
$validate = new IDCollection();
$validate->goCheck();
$ids = explode(',', $ids);
$result = ThemeModel::with('topicImg,headImg')->select($ids);
// $result = ThemeModel::getThemeList($ids);
if ($result->isEmpty()) {
throw new ThemeException();
//
// 框架会自动序列化数据为JSON,所以这里不要toJSON!
// $result = $result->hidden(['products.imgs'])
// ->toArray();
// $result = $result->hidden([
// 'products.category_id','products.stock','products.summary']);
return $result;
}
最佳答案