| @@ -310,11 +310,11 @@ | |||||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | ||||
| from wx_bill_other_deposit | from wx_bill_other_deposit | ||||
| ) bill | ) bill | ||||
| where DATEDIFF(bill.receive_date,now())=3 and bill.status not in(3,5,6) | |||||
| where bill.status not in(3,5,6) | |||||
| group by bill.tenant_id,bill.merchant_id,bill.receive_date) bill | group by bill.tenant_id,bill.merchant_id,bill.receive_date) bill | ||||
| left join wx_merchant m on bill.merchant_id=m.id | left join wx_merchant m on bill.merchant_id=m.id | ||||
| left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id | left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id | ||||
| where m.status=1 | |||||
| where m.status=1 and DATEDIFF(bill.receive_date,now())=m.bill_setting | |||||
| </select> | </select> | ||||
| @@ -396,14 +396,14 @@ | |||||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | ||||
| from wx_bill_other_deposit | from wx_bill_other_deposit | ||||
| ) bill | ) bill | ||||
| where DATEDIFF(bill.receive_date,now())=3 and bill.status not in(3,5,6) | |||||
| where bill.status not in(3,5,6) | |||||
| group by bill.tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type | group by bill.tenant_id,bill.merchant_id,bill.receive_date,bill.bill_type | ||||
| ) bill | ) bill | ||||
| left join wx_merchant m on bill.merchant_id=m.id | left join wx_merchant m on bill.merchant_id=m.id | ||||
| left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id | left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id | ||||
| left join wx_merchant_shop wms on wms.merchant_id = m.id | left join wx_merchant_shop wms on wms.merchant_id = m.id | ||||
| left join wx_shop ws on wms.shop_id = ws.id | left join wx_shop ws on wms.shop_id = ws.id | ||||
| where m.status=1 | |||||
| where m.status=1 and DATEDIFF(bill.receive_date,now())=m.bill_setting | |||||
| </select> | </select> | ||||
| <select id="getOweBillForEmail" resultType="hashmap"> | <select id="getOweBillForEmail" resultType="hashmap"> | ||||