|
@@ -822,8 +822,8 @@ func refundAuto() {
|
|
} else {
|
|
} else {
|
|
log.Println("客成到期处理")
|
|
log.Println("客成到期处理")
|
|
order1Sql := fmt.Sprintf(`select a.id from dataexport_order a INNER JOIN jy_order_detail b on a.order_code=b.order_code and a.user_id in (%s) and b.product_type in (%s) and order_status = 1 and b.service_endtime>"%s" ORDER BY b.service_endtime desc `, strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
|
|
order1Sql := fmt.Sprintf(`select a.id from dataexport_order a INNER JOIN jy_order_detail b on a.order_code=b.order_code and a.user_id in (%s) and b.product_type in (%s) and order_status = 1 and b.service_endtime>"%s" ORDER BY b.service_endtime desc `, strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
|
|
- order1 := Mysql.SelectBySql(order1Sql)
|
|
|
|
log.Println("有效订单查询", order1Sql)
|
|
log.Println("有效订单查询", order1Sql)
|
|
|
|
+ order1 := Mysql.SelectBySql(order1Sql)
|
|
if order1 == nil || len(*order1) == 0 {
|
|
if order1 == nil || len(*order1) == 0 {
|
|
isOk := false
|
|
isOk := false
|
|
order3Sql := fmt.Sprintf(`select a.* , b.product_type AS productType,b.service_starttime,b.service_endtime ,b.filter AS productFilter
|
|
order3Sql := fmt.Sprintf(`select a.* , b.product_type AS productType,b.service_starttime,b.service_endtime ,b.filter AS productFilter
|
|
@@ -831,8 +831,8 @@ func refundAuto() {
|
|
on a.order_code=b.order_code and a.user_id in (%s) and b.product_type in (%s)
|
|
on a.order_code=b.order_code and a.user_id in (%s) and b.product_type in (%s)
|
|
and order_status = 1 and b.service_endtime<"%s" ORDER BY b.service_endtime desc `,
|
|
and order_status = 1 and b.service_endtime<"%s" ORDER BY b.service_endtime desc `,
|
|
strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
|
|
strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
|
|
- _, vip_endtime := getOrderData(order3Sql)
|
|
|
|
log.Println("有效订单查询1", order3Sql)
|
|
log.Println("有效订单查询1", order3Sql)
|
|
|
|
+ _, vip_endtime := getOrderData(order3Sql)
|
|
if vip_endtime != "" {
|
|
if vip_endtime != "" {
|
|
//获取最后一个订单信息
|
|
//获取最后一个订单信息
|
|
if isRenewalProtection == 1 {
|
|
if isRenewalProtection == 1 {
|
|
@@ -1067,7 +1067,7 @@ func refundAuto() {
|
|
}
|
|
}
|
|
return true
|
|
return true
|
|
}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where is_transfer = 0`)
|
|
}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where is_transfer = 0`)
|
|
- //}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1892226`)
|
|
|
|
|
|
+ //}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1892234`)
|
|
|
|
|
|
//移交电销提醒
|
|
//移交电销提醒
|
|
for i, v := range mailData {
|
|
for i, v := range mailData {
|
|
@@ -1451,6 +1451,7 @@ func FindPositionIdClueId(uid string) (int64, string, string) {
|
|
inner join dwd_d_crm_department_level_succbi f on c.position_id=f.position_id
|
|
inner join dwd_d_crm_department_level_succbi f on c.position_id=f.position_id
|
|
ORDER BY
|
|
ORDER BY
|
|
b.service_endtime desc ,b.final_price DESC `, strings.Join(personArr, ","), "9%", strings.Join(productArr, ","))
|
|
b.service_endtime desc ,b.final_price DESC `, strings.Join(personArr, ","), "9%", strings.Join(productArr, ","))
|
|
|
|
+ log.Println("业绩归属查询:", querySql)
|
|
clueData := TiDb.SelectBySql(querySql, db.EntId)
|
|
clueData := TiDb.SelectBySql(querySql, db.EntId)
|
|
if clueData == nil || len(*clueData) == 0 {
|
|
if clueData == nil || len(*clueData) == 0 {
|
|
return 0, "", ""
|
|
return 0, "", ""
|