🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` SELECT id, customer_id, prod_inst_id, return_commission_time, return_commission_type, action FROM `cloud_aliyun_order` AS a WHERE period < 24 AND action = 'refund' AND commission_ratio > 0 AND ( commission_ratio in (9,10,15) ) AND return_commission_type = 'month' AND consume_time = 202104 AND EXISTS ( SELECT * FROM cloud_aliyun_order WHERE period < 24 AND commission_ratio > 0 AND action IN ( 'buy', 'upgrade' ) AND return_commission_type = 'month' AND id = ( SELECT id FROM cloud_aliyun_order WHERE a.prod_inst_id = prod_inst_id ORDER BY pay_time DESC LIMIT 1 ) ) ```