我想在yii2中使用默认的搜索和分页。但是查询很复杂,我不知道如何将它添加到搜索模型中!这是一个查询:FROMproduct p
SELECT id,product_id , IF(sum(quantity) IS NULL, 0, sum(quantity)) AS po_sum
FROM purchase_order_products inner join purchase_order on purchase_order.id = purchase_order_products.purchase