【发布时间】:2016-05-09 13:37:14
【问题描述】:
我手头有这个特殊的查询,我想把它写成一个 cakephp 查询,但是有太多特殊的东西,我没有尝试对我有用:
select concat(c.name,' - ',e.name) as workplace
from vacancies v, states e, citys c
where c.idstate = e.id
and v.idstate = c.idstate
and v.idcity = c.id;
我真的不知道如何将这个查询字面翻译成 cakephp 风格,有点像:
$workplace = $this->Vacancies->Cities->find(...)->where(...);
【问题讨论】:
-
请提供您尝试过的示例。
-
我试过这样的事情:$workplace = $this->Vacancys->Cities->find('list')->select("concat(Citys.name,' - ',State .name)")->where(..不用担心条件..); mysql sql cakephp cakephp-3.0
标签: mysql sql cakephp cakephp-3.0