采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
最后测试结果是这样的
查询方法里别加空格
比如本节里:
$product = self::with('imgs,properties') ->find($id);
self::with('')中的查询字段加空格就会报你这样的错误
// 比如$product = self::with(' imgs,properties') ->find($id);// 或者$product = self::with('imgs, properties') ->find($id);
// 比如
$product = self::with(' imgs,properties') ->find($id);
// 或者
$product = self::with('imgs, properties') ->find($id);
从这个信息只能看出,img是不存在的。至于代码怎么写错的,还需要调试呀。可以对下源码看看。
登录后可查看更多问答,登录/注册
全栈工程师/前后端都讲/架构思想/ RESTFul API、MySQL表设计
1.1k 23
1.2k 21
1.2k 19
941 18
1.0k 18