|
@@ -720,8 +720,7 @@ func refundAuto() {
|
|
|
order1 := TiDb.SelectBySql(`select id from dwd_f_userbase_order_info where uid=? and (product_type = "企业商机管理" or product_type = "大会员") and vip_endtime > ? and order_status = 1 `, uid, findNowTime)
|
|
|
if order1 == nil || len(*order1) == 0 {
|
|
|
isOk := false
|
|
|
- earliestTime := time.Now().AddDate(0, 0, gconv.Int(-db.HandoverCycle)).Format(date.Date_Full_Layout)
|
|
|
- order3 := TiDb.SelectBySql(`select vip_endtime from dwd_f_userbase_order_info where uid=? and (product_type = "企业商机管理" or product_type = "大会员") and vip_endtime < ? and vip_endtime>? and order_status = 1 ORDER BY vip_endtime desc limit 1 `, uid, findNowTime, earliestTime)
|
|
|
+ order3 := TiDb.SelectBySql(`select vip_endtime from dwd_f_userbase_order_info where uid=? and (product_type = "企业商机管理" or product_type = "大会员") and vip_endtime < ? and order_status = 1 ORDER BY vip_endtime desc limit 1 `, uid, findNowTime)
|
|
|
if order3 != nil && len(*order3) > 0 {
|
|
|
//获取最后一个订单信息
|
|
|
vv := (*order3)[0]
|
|
@@ -755,7 +754,6 @@ func refundAuto() {
|
|
|
"remrk": "1天后即将移交",
|
|
|
"reason": "成交客户续费失败",
|
|
|
})
|
|
|
- isOk = true
|
|
|
} else if time.Now().Unix()-vip_endtimes.Unix() < db.HandoverCycle*86400 {
|
|
|
isOk = true
|
|
|
}
|
|
@@ -1266,7 +1264,7 @@ func KcOrderFormat(orderCode string, bigmemberService, combo map[int64]string) *
|
|
|
orderData := Mysql.SelectBySql(`SELECT a.id,a.order_code,a.pay_money,a.user_phone,a.vip_starttime,a.vip_endtime,a.product_type,a.filter,a.user_id,a.ent_id,a.company_name,a.create_person,SUM(b.return_money) AS return_money
|
|
|
FROM jianyu.dataexport_order a
|
|
|
LEFT JOIN return_money_record b ON (a.order_code=b.order_code)
|
|
|
- WHERE a.order_code=? AND a.order_status=1 AND (a.product_type='大会员' OR a.product_type='大会员-子账号')
|
|
|
+ WHERE a.order_code=? AND a.order_status=1 AND (a.product_type='大会员' OR a.product_type='大会员-子账号' or a.product_type = "企业商机管理")
|
|
|
GROUP BY a.id ORDER BY a.autoUpdate`, orderCode)
|
|
|
data := &OrderInfo{}
|
|
|
if orderData != nil && len(*orderData) > 0 {
|