我到目前爲止能夠在zend2 SELECT查詢中應用AND和LIKE,但無法弄清楚如何應用OR運算符。這是我的查詢:如何在zend2選擇查詢中應用OR運算符
$this->table = $data['table'];
$select = new Select();
$spec = function (Where $where) {
$where->like('title', 'border%');
};
$select->from($this->table)
->where(array('id'=> 8));
$select->where($spec);
$resultSet = $this->selectWith($select);
$resultSet->buffer();
return $resultSet;
它返回這條SQL語句
SELECT `rs_morning_report`.*
FROM `rs_morning_report`
WHERE `id` = :where1 AND `title` LIKE :where2
現在我想添加 「AND(部門LIKE%A%或部門LIKE%B%)」