feat: can fulfillment sku order filter
This commit is contained in:
@@ -23,6 +23,15 @@
|
||||
o.`deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">AND o.`store_id` = #{storeId}</if>
|
||||
<if test="customerId != null and customerId != ''">AND o.`customer_id` = #{customerId}</if>
|
||||
<if test="fulfillableSkuId != null and fulfillableSkuId != ''">
|
||||
AND o.`status` <> 'CANCELLED'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM `gao_sales_order_item` i
|
||||
WHERE i.`sales_order_id` = o.`id` AND i.`deleted_at` IS NULL
|
||||
AND i.`sku_id` = #{fulfillableSkuId}
|
||||
AND COALESCE(i.`fulfilled_base_quantity`, 0) + COALESCE(i.`reserved_base_quantity`, 0) < COALESCE(i.`base_quantity`, 0)
|
||||
)
|
||||
</if>
|
||||
<if test="packageConfigId != null and packageConfigId != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM `gao_customer_package` cp
|
||||
|
||||
Reference in New Issue
Block a user