【发布时间】:2018-10-01 08:38:39
【问题描述】:
我有一个使用 Propel 2 的项目,我想在某个字段上加入两个表,但那里没有外键关系。我只想根据该值匹配它们。不幸的是,我无法让它工作,而 Propel 的文档,尽管它试图做到彻底,但仍然缺乏很好的参考。我该怎么做?
我尝试过的:
echo Table1Query::create()
->addJoin(Table1TableMap::COL_A, Table2TableMap::COL_B)
->where('Table2.C=?', 'asd')
->toString();
这在where() 部分失败,System error Cannot determine the column to bind to the parameter in clause "Table2.C=?".
我知道我可以得到 PDO 连接并退回到纯 SQL,这肯定会更容易,但使用 ORM 时感觉有点不对劲 (then again...)。
【问题讨论】: