我有以下sql查询:选择*自 tbl_location_manager 其中locid在(4,5)和lctype中=三我已经用where=条件编写了查询
tbl_location_manager
$sqlSelect = $this->tableGateway->getSql()->select(); $sqlSelect->where(array('locid' => '4'));
但找不到in()的任何解决方案。
dgenwo3n1#
这里有一个解决方案:
use Zend\Db\Select\Where; $where = new Where(); $where->in('locid', [4, 5]); $sqlSelect = $this->tableGateway->getSql()->select(); $sqlSelect->where($where);
1条答案
按热度按时间dgenwo3n1#
这里有一个解决方案: