我有以下代码:
$select = new Select();
$select->from($this->table);
$select->columns(array('id', 'refNumberOrder', 'dateOrder', 'kontragent', 'airOperator', 'aircraft', 'status'));
...
if ($object->customer != '') {
$select->where->like('library_kontragent.short_name', $object->customer . '%');
}
if ($object->airOperator != '') {
$select->where->like('library_air_operator.short_name', $object->airOperator . '%');
}
if ($object->aircraft != '') {
$select->where->like('library_aircraft_type.name', $object->aircraft . '%');
}
$select->order('dateOrder ' . Select::ORDER_DESCENDING);
//\Zend\Debug\Debug::dump($select->getSqlString());
$resultSet = $this->selectWith($select);
$resultSet->buffer();
这就是下一行:
// MySQL result
WHERE "library_kontragent"."short_name" LIKE 'test%'
AND "library_air_operator"."short_name" LIKE 'test%'
AND "library_aircraft_type"."name" LIKE 'test%'
ORDER BY "dateOrder" DESC"
我如何获得下一个字符串?
// MySQL result
WHERE ("library_kontragent"."short_name" LIKE 'test%' OR "library_kontragent"."long_name" LIKE 'test%')
AND "library_air_operator"."short_name" LIKE 'test%'
AND "library_aircraft_type"."name" LIKE 'test%'
ORDER BY "dateOrder" DESC"