我有一个 magento 集合,如果我回显 getSelect() 函数,我会得到一个类似这样的查询:
SELECT
`table1`.*,
`table`.*,
`table3.fieldy` AS 'fieldname'
.....
FROM ....
WHERE....
我想将此查询更改为如下内容:
SELECT
`table1`.*,
`table`.*,
`table3.fieldy` AS 'fieldname',
(SELECT col1, col2, (case when (action == 2 and state == 0) then 1 else 0 end) as state from tbl1) AS 'fieldname2'
......
FROM....
WHERE....
现在,例如对于 where 子句,您可以使用向查询添加文本
productCollection->getSelect()->where('query text');
但是如何将自定义查询文本添加到选择的第一部分?
非常感谢