我收到以下查询:
SELECT SQL_CALC_FOUND_ROWS u.unit_id, u.unit_serial_full, u.unit_status, u.contract_id, u.warehouse_id,
m.model_name,
c.contract_name,
t.transfer_id,
w.warehouse_name_full
FROM units AS u
LEFT JOIN models AS m ON m.model_id = u.model_id
LEFT JOIN contracts AS c ON c.contract_id = u.contract_id
LEFT JOIN transfers AS t ON t.transfer_id = u.transfer_id
LEFT JOIN warehouses AS w ON w.warehouse_id = u.warehouse_id
LEFT JOIN units_attributes AS ua ON ua.unit_id = u.unit_id
WHERE 1
AND u.company_id = :company_id
AND (
(
u.model_id = "4"
AND (
ua.attribute_id = :attribute_id_0 AND attribute_default = :attribute_value_0
)
AND (
ua.attribute_id = :attribute_id_1 AND attribute_default = :attribute_value_1
)
)
)
如果我使用 2 个或更多属性进行搜索,它不会给出任何结果,但如果我只有 1 个属性,则查询会按预期工作。有任何想法吗 ?
搜索必须严格。不带通配符。
谢谢。