首页 > 其他 > 详细

Can't obtain the model 'aid' source from the _models list

时间:2014-09-29 16:00:52      阅读:302      评论:0      收藏:0      [点我收藏+]

以下是被执行的代码:

	$areas = $this->builder->from(‘area‘)
		->where(‘aid = 0‘)
		->getQuery()
		->execute()
		->toArray();

	$this->view->setVar(‘areas‘, $areas);

经过研究才发现原来where里面的字段要带着表名的,正确代码:

	$areas = $this->builder->from(‘area‘)
		->where(‘area.aid = 0‘)
		->getQuery()
		->execute()
		->toArray();

	$this->view->setVar(‘areas‘, $areas);


本文出自 “天道酬勤” 博客,请务必保留此出处http://ivendor.blog.51cto.com/8613733/1559303

Can't obtain the model 'aid' source from the _models list

原文:http://ivendor.blog.51cto.com/8613733/1559303

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!