|
@@ -52,7 +52,7 @@ FROM (
|
|
SUM(sorder_qty) as sum_sorder_qty
|
|
SUM(sorder_qty) as sum_sorder_qty
|
|
FROM dbr_sorder as mx
|
|
FROM dbr_sorder as mx
|
|
INNER JOIN dbr_sorder_bd as mb ON mx.id = mb.sorder_id
|
|
INNER JOIN dbr_sorder_bd as mb ON mx.id = mb.sorder_id
|
|
- WHERE _where AND sorder_date >= previous_month_start_date and sorder_date <= previous_month_end_date
|
|
|
|
|
|
+ WHERE true and reward_date between '20240801' and '20240831' AND sorder_date >= previous_month_start_date and sorder_date <= previous_month_end_date
|
|
GROUP BY seller_id, item_id
|
|
GROUP BY seller_id, item_id
|
|
) as june_data ON mc.id = june_data.seller_id AND md.id = june_data.item_id
|
|
) as june_data ON mc.id = june_data.seller_id AND md.id = june_data.item_id
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
@@ -62,7 +62,7 @@ FROM (
|
|
SUM(CASE WHEN mx.status = 'C' THEN sorder_qty ELSE 0 END) AS sum_sorder_claim_qty
|
|
SUM(CASE WHEN mx.status = 'C' THEN sorder_qty ELSE 0 END) AS sum_sorder_claim_qty
|
|
FROM dbr_sorder as mx
|
|
FROM dbr_sorder as mx
|
|
INNER JOIN dbr_sorder_bd as mb ON mx.id = mb.sorder_id
|
|
INNER JOIN dbr_sorder_bd as mb ON mx.id = mb.sorder_id
|
|
- WHERE _where AND sorder_date >= start_date and sorder_date <= end_date
|
|
|
|
|
|
+ WHERE true and reward_date between '20240801' and '20240831' AND sorder_date >= start_date and sorder_date <= end_date
|
|
GROUP BY seller_id, item_id
|
|
GROUP BY seller_id, item_id
|
|
) as july_data ON mc.id = july_data.seller_id AND md.id = july_data.item_id
|
|
) as july_data ON mc.id = july_data.seller_id AND md.id = july_data.item_id
|
|
WHERE me.cgroup_code = 'A-0001'
|
|
WHERE me.cgroup_code = 'A-0001'
|