简体   繁体   English

我想在zend框架中使用if in where子句

[英]I want to use an if in where clause in zend framework

The following is part of my query where if(teler.arrange ="Y",(teler.id_to IN ('1940')),0) GROUP BY to , 以下是我的查询的一部分, where if(teler.arrange ="Y",(teler.id_to IN ('1940')),0) GROUP BY,

How will I have this in a Zend query which is currently like this 我将如何在目前这样的Zend查询中使用它

$objSelect->Orwhere('teler.id IN (?))', $where['id']);

That's pretty straightforward: 这很简单:

$objSelect->orWhere('if(teler.arrange ="Y", (teler.id_to IN (?)), 0)', $where['id'])
          ->group('to');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM