显示可连接中没有记录的项目
我正在使用 CakePHP 构建一个应用程序,您可以在其中填写调查。我提出的问题如下:
我有两个表:
调查/调查用户(HABTM)
当有人填写调查时,将在调查用户中进行记录,当调查被接受时,调查不应再可见。所以我想从调查表中选择在 SurveysUsers 表中没有记录的调查。
希望大家能够帮助我!
谢谢德韦恩
I'm building an application with CakePHP on which you can fill in surveys. The problem i came up with is the following:
I have two tables:
Surveys / SurveysUsers (HABTM)
When somebody fills in a survey a record will be made in SurveysUsers and when the Survey is accepted the survey shouldn't be visible anymore. So i want to select the surveys from the surveys table which don't have a record in the SurveysUsers table.
Hope u all can help me!
Thanks
Dwayne
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即兴尝试一下:
原则是将 habtm 模型绑定为 hasone,然后就可以在条件中使用字段。查看文档
Just off the cuff, try this:
The principle is that you bind the habtm model as hasone and then you can use the fields in your conditions. Have a look in the Docs