|
@@ -41,6 +41,7 @@ FROM
|
|
|
AND ( a.refund_status != 1 OR a.refund_status IS NULL )
|
|
|
AND b.service_starttime < "2099-01-01" AND b.service_endtime > now()
|
|
|
AND b.update_time > "%s"
|
|
|
+
|
|
|
ORDER BY
|
|
|
b.update_time asc ,
|
|
|
a.order_code ASC,
|
|
@@ -1983,7 +1984,7 @@ func addClueNameChangeRecord(clueType, clueId int64, oldName, newName string, kc
|
|
|
description = "订单公司信息变更"
|
|
|
}
|
|
|
//新增变更记录
|
|
|
- AddClueChange(clueId, kcPositionId, "cluename", "基本信息变更", oldName, newName, nowTime, common.GetRandom(32), description, "")
|
|
|
+ AddClueChange(clueId, kcPositionId, "cluename", "基本信息变更", oldName, newName, nowTime, common.GetRandom(32), "", description)
|
|
|
}
|
|
|
|
|
|
func updateClueTransfer(clueId int64, nowTime string) {
|
|
@@ -2108,6 +2109,7 @@ func EntOperateHandle() {
|
|
|
if number == 80 {
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"isUse": 1,
|
|
|
})
|
|
@@ -2130,6 +2132,7 @@ func EntOperateHandle() {
|
|
|
//没有归集需要等一等
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"number": number,
|
|
|
})
|
|
@@ -2144,6 +2147,7 @@ func EntOperateHandle() {
|
|
|
log.Println("企业操作线索不存在:", uid)
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"number": number,
|
|
|
})
|
|
@@ -2156,7 +2160,8 @@ func EntOperateHandle() {
|
|
|
isCreate := false
|
|
|
isTransfer := false
|
|
|
oldClueType := int64(0)
|
|
|
- minEntry, _ := GetPersonIdentityPower(uid, 5, entId, gconv.String((*clueData)["cluename"]))
|
|
|
+ minEntry, _ := GetPersonIdentityPower(uid, gconv.Int(common.If(operate > 0, 51, 52)), entId, gconv.String((*clueData)["cluename"]))
|
|
|
+ //minEntry, _ := GetPersonIdentityPower(uid, gconv.Int(common.If(operate > 0, 51, 52)), entId, "2222")
|
|
|
newClueType := int64(0)
|
|
|
if minEntry != nil {
|
|
|
newClueType = gconv.Int64(minEntry["newAccountType"])
|
|
@@ -2172,6 +2177,7 @@ func EntOperateHandle() {
|
|
|
//之前不在客成 没有权限 不需要处理
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"isUse": 1,
|
|
|
})
|
|
@@ -2210,12 +2216,13 @@ func EntOperateHandle() {
|
|
|
if minEntry == nil {
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"isUse": 1,
|
|
|
})
|
|
|
continue
|
|
|
}
|
|
|
- //新增
|
|
|
+ //查看是否创建
|
|
|
if isCreate {
|
|
|
if isTransfer {
|
|
|
//在客成
|
|
@@ -2252,8 +2259,8 @@ func EntOperateHandle() {
|
|
|
if isCreate && isTransfer {
|
|
|
if newClueType == 0 {
|
|
|
//查询不到其他权限
|
|
|
- productName := GetProductName(gconv.Int64((*customData)["product_access"]))
|
|
|
//走退出
|
|
|
+ productName := GetProductName(gconv.Int64((*customData)["product_access"]))
|
|
|
changeReason := ""
|
|
|
switch operate {
|
|
|
case -1:
|
|
@@ -2270,6 +2277,15 @@ func EntOperateHandle() {
|
|
|
changeReason = fmt.Sprintf("%s权限被企业删除", productName)
|
|
|
}
|
|
|
kcToOpenSeaUpdate(clueId, gconv.Int64((*customData)["position_id"]), oldClueType, changeReason)
|
|
|
+ if isPower {
|
|
|
+ //需要重新进课程
|
|
|
+ FormatData(map[string]interface{}{
|
|
|
+ "belong_to": "0100",
|
|
|
+ "source": "0101",
|
|
|
+ "uid": uid,
|
|
|
+ "phone": "phone",
|
|
|
+ }, "powerdDele")
|
|
|
+ }
|
|
|
} else {
|
|
|
//已创建 在客成可继续处理 其他不需要操作
|
|
|
if newClueType >= oldClueType {
|
|
@@ -2283,6 +2299,7 @@ func EntOperateHandle() {
|
|
|
} else {
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"isUse": 1,
|
|
|
})
|
|
@@ -2290,6 +2307,7 @@ func EntOperateHandle() {
|
|
|
}
|
|
|
Mysql.Update("ent_operate_record", map[string]interface{}{
|
|
|
"entUserId": entUserId,
|
|
|
+ "isUse": 0,
|
|
|
}, map[string]interface{}{
|
|
|
"isUse": 1,
|
|
|
})
|