记得上下班打卡 | git大法好,push需谨慎

Commit ccc9ac20 authored by GaoHu's avatar GaoHu

修改sql

parent 4669b4cf
...@@ -725,15 +725,12 @@ GROUP BY user_mobile,tickets_id; ...@@ -725,15 +725,12 @@ GROUP BY user_mobile,tickets_id;
kp.time_end AS timeEnd, kp.time_end AS timeEnd,
kp.time_start AS timeStart, kp.time_start AS timeStart,
kp.`comment`, kp.`comment`,
IFNULL(map.`open`,0) AS open , IFNULL( map.`open`, 0 ) AS OPEN,
IFNULL(map.price,0) AS totalSalePrice , IFNULL( map.price, 0 ) AS totalSalePrice,
kps.`status` kps.`status`
FROM FROM
kylin_performances AS kp kylin_performances AS kp
LEFT JOIN kylin_performance_status AS kps ON kps.performance_id = kp.performances_id LEFT JOIN kylin_performance_status AS kps ON kps.performance_id = kp.performances_id
LEFT JOIN kylin_ticket_time_relation AS kttr ON kttr.performance_id = kp.performances_id
LEFT JOIN kylin_ticket_relations AS ktr ON ktr.times_id = kttr.times_id
INNER JOIN kylin_ticket_status AS kts ON kts.ticket_id = ktr.ticket_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
kk.performance_id, kk.performance_id,
...@@ -754,17 +751,16 @@ GROUP BY user_mobile,tickets_id; ...@@ -754,17 +751,16 @@ GROUP BY user_mobile,tickets_id;
kylin_order_ticket_relations AS kotr kylin_order_ticket_relations AS kotr
LEFT JOIN kylin_order_ticket_status AS kots ON kotr.order_id = kots.order_id LEFT JOIN kylin_order_ticket_status AS kots ON kotr.order_id = kots.order_id
INNER JOIN smile_user AS su ON su.uid = kotr.agent_id INNER JOIN smile_user AS su ON su.uid = kotr.agent_id
WHERE kots.status in (1,6) WHERE
kots.STATUS IN ( 1, 6 )
) AS kk ON kot.order_tickets_id = kk.order_id ) AS kk ON kot.order_tickets_id = kk.order_id
WHERE WHERE
kk.agent_id != 0 kk.agent_id != 0
GROUP BY kk.performance_id GROUP BY
kk.performance_id
) AS map ON map.performance_id = kp.performances_id ) AS map ON map.performance_id = kp.performances_id
WHERE WHERE
kts.is_agent = 1 kp.performances_id IN ( SELECT sa.performance_id FROM smile_agent AS sa WHERE sa.del_tag = 0 GROUP BY sa.performance_id )
AND kp.performances_id IN (SELECT sa.performance_id FROM smile_agent sa WHERE sa.del_tag = 0 GROUP BY sa.performance_id)
GROUP BY
kp.performances_id
ORDER BY ORDER BY
kp.COMMENT DESC, kp.COMMENT DESC,
kp.time_start ASC kp.time_start ASC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment