|
@@ -16,7 +16,7 @@ import (
|
|
|
|
|
|
// 电销工单生成
|
|
// 电销工单生成
|
|
func rderAcceptance() {
|
|
func rderAcceptance() {
|
|
- sql := fmt.Sprintf(`select * from order_acceptance where is_clue=2 order by propose_time `)
|
|
|
|
|
|
+ sql := fmt.Sprintf(`select * from order_acceptance where is_clue=2 and is_delete=1 order by propose_time `)
|
|
data := WorkOrder.SelectBySql(sql)
|
|
data := WorkOrder.SelectBySql(sql)
|
|
if data != nil && len(*data) > 0 {
|
|
if data != nil && len(*data) > 0 {
|
|
for _, v := range *data {
|
|
for _, v := range *data {
|
|
@@ -73,10 +73,11 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
isGroup, isCommerce := GetCompanyType(cluename)
|
|
isGroup, isCommerce := GetCompanyType(cluename)
|
|
uCount, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
|
|
uCount, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
|
|
if uCount != nil && len(*uCount) > 0 {
|
|
if uCount != nil && len(*uCount) > 0 {
|
|
|
|
+ clueId := gconv.Int64((*uCount)["id"])
|
|
positionId := gconv.Int64((*uCount)["position_id"])
|
|
positionId := gconv.Int64((*uCount)["position_id"])
|
|
if positionId == 0 {
|
|
if positionId == 0 {
|
|
//线索变更
|
|
//线索变更
|
|
- ok, data, saleData = FindPosition(positionId, "")
|
|
|
|
|
|
+ ok, data, saleData = FindPosition(positionId, "", false)
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -85,9 +86,29 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
trailstatusl := gconv.String((*uCount)["trailstatusl"])
|
|
trailstatusl := gconv.String((*uCount)["trailstatusl"])
|
|
if trailstatusl == "01" || trailstatusl == "03" || trailstatusl == "04" {
|
|
if trailstatusl == "01" || trailstatusl == "03" || trailstatusl == "04" {
|
|
//变更销售员
|
|
//变更销售员
|
|
|
|
+ ok, data, saleData = FindPosition(positionId, "", false)
|
|
|
|
+ if !ok {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
+ } else if trailstatusl == "08" {
|
|
|
|
+ //客成
|
|
|
|
+ //查找客成人员标识
|
|
|
|
+ customerMap := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{
|
|
|
|
+ "clue_id": clueId,
|
|
|
|
+ }, "position_id", "")
|
|
|
|
+ if customerMap != nil && len(*customerMap) > 0 {
|
|
|
|
+ UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String((*uCount)["name"]), phone, "", "", "", "", "", "", gconv.String((*uCount)["seat_number"]), "", gconv.Int64((*uCount)["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
+ data = map[string]interface{}{
|
|
|
|
+ "type": "kc",
|
|
|
|
+ "position_id": (*customerMap)["position_id"],
|
|
|
|
+ "name": (*customerMap)["name"],
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
//线索变更
|
|
//线索变更
|
|
- ok, data, saleData = FindPosition(positionId, trailstatusl)
|
|
|
|
|
|
+ ok, data, saleData = FindPosition(positionId, trailstatusl, false)
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -96,17 +117,17 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//新增线索
|
|
//新增线索
|
|
- ok, data, _ = FindPosition(0, "")
|
|
|
|
|
|
+ ok, data, _ = FindPosition(0, "", false)
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
SaveClue("", "", uId, "", "", "", "", cluename, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, false, demand)
|
|
SaveClue("", "", uId, "", "", "", "", cluename, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, false, demand)
|
|
}
|
|
}
|
|
//工单生成
|
|
//工单生成
|
|
- AddOrderWork(acceptanceData, data, product)
|
|
|
|
|
|
+ AddOrderWork(acceptanceData, data, product, phone, company)
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
-func AddOrderWork(acceptanceData map[string]interface{}, userData map[string]interface{}, product string) {
|
|
|
|
|
|
+func AddOrderWork(acceptanceData map[string]interface{}, userData map[string]interface{}, product, phone, company string) bool {
|
|
nowTime := time.Now().Format(date.Date_Full_Layout)
|
|
nowTime := time.Now().Format(date.Date_Full_Layout)
|
|
work_order_no := fmt.Sprintf("GD%s%s", time.Now().Format(date.Date_Short_Layout), FindNumber("gd"))
|
|
work_order_no := fmt.Sprintf("GD%s%s", time.Now().Format(date.Date_Short_Layout), FindNumber("gd"))
|
|
productArr := []string{}
|
|
productArr := []string{}
|
|
@@ -122,14 +143,14 @@ func AddOrderWork(acceptanceData map[string]interface{}, userData map[string]int
|
|
"work_order_no": work_order_no,
|
|
"work_order_no": work_order_no,
|
|
"acceptance_no": gconv.String(acceptanceData["acceptance_no"]),
|
|
"acceptance_no": gconv.String(acceptanceData["acceptance_no"]),
|
|
"type": strings.Join(productArr, ","),
|
|
"type": strings.Join(productArr, ","),
|
|
- "status": 1,
|
|
|
|
|
|
+ "status": common.If(gconv.Int64(userData["orderStatus"]) == 0, 1, 2),
|
|
"initiator_name": gconv.String(acceptanceData["creator_name"]),
|
|
"initiator_name": gconv.String(acceptanceData["creator_name"]),
|
|
"initiator_position_id": gconv.String(acceptanceData["initiator_position_id"]),
|
|
"initiator_position_id": gconv.String(acceptanceData["initiator_position_id"]),
|
|
"current_name": userData["name"],
|
|
"current_name": userData["name"],
|
|
"current_position_id": userData["position_id"],
|
|
"current_position_id": userData["position_id"],
|
|
"is_delete": 1,
|
|
"is_delete": 1,
|
|
"creator_name": gconv.String(acceptanceData["creator_name"]),
|
|
"creator_name": gconv.String(acceptanceData["creator_name"]),
|
|
- "creator_position_id": gconv.String(acceptanceData["gconv.String(acceptanceData[\"department_name\"])"]),
|
|
|
|
|
|
+ "creator_position_id": gconv.String(acceptanceData["creator_position_id"]),
|
|
"creator_time": nowTime,
|
|
"creator_time": nowTime,
|
|
"two_type": "dx",
|
|
"two_type": "dx",
|
|
"department_no": gconv.String(acceptanceData["department_no"]),
|
|
"department_no": gconv.String(acceptanceData["department_no"]),
|
|
@@ -143,7 +164,83 @@ func AddOrderWork(acceptanceData map[string]interface{}, userData map[string]int
|
|
"is_clue": 3,
|
|
"is_clue": 3,
|
|
})
|
|
})
|
|
//发送邮件
|
|
//发送邮件
|
|
|
|
+ personMap := GetPerson(gconv.String(userData["position_id"]))
|
|
|
|
+ if personMap == nil || len(personMap) == 0 {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ WorkMail(personMap,
|
|
|
|
+ strings.Join(productArr, ","),
|
|
|
|
+ gconv.Int64(common.If(gconv.Int64(userData["orderStatus"]) == 0, 1, 2)),
|
|
|
|
+ gconv.String(personMap["name"]),
|
|
|
|
+ gconv.String(acceptanceData["creator_name"]),
|
|
|
|
+ nowTime,
|
|
|
|
+ gconv.String(acceptanceData["acceptance_no"]),
|
|
|
|
+ phone,
|
|
|
|
+ company)
|
|
|
|
+ return true
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 本级以及上级管理员查询
|
|
|
|
+func GetPerson(positionId string) map[string]interface{} {
|
|
|
|
+ person := map[string]interface{}{}
|
|
|
|
+ positionArrMap := Base.SelectBySql(fmt.Sprintf(`select a.phone,b.id,b.ent_id from
|
|
|
|
+ base_user a
|
|
|
|
+ INNER JOIN base_position b
|
|
|
|
+ on b.id=%s and b.user_id=a.id and b.type=1`,
|
|
|
|
+ positionId))
|
|
|
|
+ if positionArrMap == nil || len(*positionArrMap) == 0 {
|
|
|
|
+ return map[string]interface{}{}
|
|
|
|
+ }
|
|
|
|
+ phone := gconv.String((*positionArrMap)[0]["phone"])
|
|
|
|
+ entId := gconv.String((*positionArrMap)[0]["ent_id"])
|
|
|
|
+ entUserArrMap := Mysql.SelectBySql(fmt.Sprintf(`SELECT
|
|
|
|
+ a.name as name,a.mail as mail,b.dept_id as deptId,a.phone
|
|
|
|
+FROM
|
|
|
|
+ entniche_user a
|
|
|
|
+ INNER JOIN entniche_department_user b ON a.ent_id =%s
|
|
|
|
+ AND a.phone IN %s
|
|
|
|
+ and a.id=b.user_id`, entId, fmt.Sprintf("(%s)", phone)))
|
|
|
|
+ //商机管理员
|
|
|
|
+ if entUserArrMap == nil || len(*entUserArrMap) == 0 {
|
|
|
|
+ return map[string]interface{}{}
|
|
|
|
+ }
|
|
|
|
+ deptId := gconv.Int64((*entUserArrMap)[0]["deptId"])
|
|
|
|
+ person = map[string]interface{}{
|
|
|
|
+ "name": gconv.String((*entUserArrMap)[0]["name"]),
|
|
|
|
+ "mail": gconv.String((*entUserArrMap)[0]["mail"]),
|
|
|
|
+ "phone": gconv.String((*entUserArrMap)[0]["phone"]),
|
|
|
|
+ }
|
|
|
|
+ //本部门管理员查询
|
|
|
|
+ depthMap := Mysql.SelectBySql(`SELECT
|
|
|
|
+ c.name as name,c.mail as mail
|
|
|
|
+ FROM
|
|
|
|
+ entniche_department_user a
|
|
|
|
+ INNER JOIN entniche_user_role b ON a.dept_id = ?
|
|
|
|
+ AND a.user_id = b.user_id
|
|
|
|
+ AND b.role_id =2
|
|
|
|
+ INNER JOIN entniche_user c ON a.user_id = c.id`, deptId)
|
|
|
|
+ if depthMap != nil && len(*depthMap) > 0 {
|
|
|
|
+ person["deptPersonName"] = gconv.String((*depthMap)[0]["name"])
|
|
|
|
+ person["deptPersonMail"] = gconv.String((*depthMap)[0]["mail"])
|
|
|
|
+ }
|
|
|
|
+ //商机管理员查询
|
|
|
|
+ superiorDepthMap := Mysql.SelectBySql(`SELECT
|
|
|
|
+ c.*
|
|
|
|
+FROM
|
|
|
|
+ entniche_department d
|
|
|
|
+ INNER JOIN entniche_department_user a ON d.id = ?
|
|
|
|
+ AND d.pid = a.dept_id
|
|
|
|
+ INNER JOIN entniche_user_role b ON a.user_id = b.user_id
|
|
|
|
+ AND b.role_id = 1
|
|
|
|
+ INNER JOIN entniche_user c ON a.user_id = c.id`, deptId)
|
|
|
|
+ if superiorDepthMap != nil && len(*superiorDepthMap) > 0 {
|
|
|
|
+ person["superiorDepthPersonName"] = gconv.String((*superiorDepthMap)[0]["name"])
|
|
|
|
+ person["superiorDepthPersonMail"] = gconv.String((*superiorDepthMap)[0]["mail"])
|
|
|
|
+ }
|
|
|
|
+ return person
|
|
}
|
|
}
|
|
|
|
|
|
// 编号查询
|
|
// 编号查询
|
|
@@ -160,108 +257,9 @@ func FindNumber(moudle string) string {
|
|
return fmt.Sprintf("%04d", count)
|
|
return fmt.Sprintf("%04d", count)
|
|
}
|
|
}
|
|
|
|
|
|
-/*func updateClue(uCount *map[string]interface{}, company, phone, demand, name string, position string, administrators map[string]interface{}) {
|
|
|
|
- clueId := gconv.Int64((*uCount)["id"])
|
|
|
|
- oldCompany := gconv.String((*uCount)["oldCompany"])
|
|
|
|
- oldPhone := gconv.String((*uCount)["oldPhone"])
|
|
|
|
- oldDemand := gconv.String((*uCount)["oldDemand"])
|
|
|
|
- oldName := gconv.String((*uCount)["oldName"])
|
|
|
|
- nowTime := time.Now().Format(date.Date_Full_Layout)
|
|
|
|
- old_position := gconv.String((*uCount)["position_id"])
|
|
|
|
- updateData := map[string]interface{}{}
|
|
|
|
- if company != "" && company != oldCompany {
|
|
|
|
- updateData["cluename"] = company
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "position_id": common.If(position != "", position, "-1"),
|
|
|
|
- "change_field": "cluename",
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": oldCompany,
|
|
|
|
- "new_value": company,
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if phone != "" && phone != oldPhone {
|
|
|
|
- updateData["phone"] = phone
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "position_id": common.If(position != "", position, "-1"),
|
|
|
|
- "change_field": "phone",
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": oldPhone,
|
|
|
|
- "new_value": phone,
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if name != "" && name != oldName {
|
|
|
|
- updateData["name"] = name
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "position_id": common.If(position != "", position, "-1"),
|
|
|
|
- "change_field": "name",
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": oldName,
|
|
|
|
- "new_value": name,
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if demand != "" && demand != oldDemand {
|
|
|
|
- updateData["demand"] = demand
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "position_id": common.If(position != "", position, "-1"),
|
|
|
|
- "change_field": "demand",
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": oldDemand,
|
|
|
|
- "new_value": demand,
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if old_position != position && position != "" {
|
|
|
|
- //员工更改
|
|
|
|
- updateData["position_id"] = position
|
|
|
|
- updateData["seatNumber"] = "seatNumber"
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "change_field": "position",
|
|
|
|
- "position_id": 0,
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": common.If(old_position != "", old_position, "/"),
|
|
|
|
- "new_value": common.If(position != "", position, "/"),
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1})
|
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
|
- "clue_id": clueId,
|
|
|
|
- "change_field": "position",
|
|
|
|
- "position_id": 0,
|
|
|
|
- "change_type": "基本信息变更",
|
|
|
|
- "old_value": common.If(old_position != "", old_position, "/"),
|
|
|
|
- "new_value": common.If(position != "", position, "/"),
|
|
|
|
- "createtime": nowTime,
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1})
|
|
|
|
- }
|
|
|
|
- if updateData != nil {
|
|
|
|
- TiDb.Update("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
|
- "uid": clueId,
|
|
|
|
- },
|
|
|
|
- updateData)
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-*/
|
|
|
|
// 人员查询
|
|
// 人员查询
|
|
-func FindPosition(positionId int64, trailstatusl string) (bool, map[string]interface{}, []map[string]interface{}) {
|
|
|
|
|
|
+func FindPosition(positionId int64, trailstatusl string, full bool) (bool, map[string]interface{}, []map[string]interface{}) {
|
|
allData := []map[string]interface{}{}
|
|
allData := []map[string]interface{}{}
|
|
- full := false
|
|
|
|
//查询是否满了
|
|
//查询是否满了
|
|
if positionId != 0 {
|
|
if positionId != 0 {
|
|
if FindUpperLimit(gconv.String(positionId), "", false) {
|
|
if FindUpperLimit(gconv.String(positionId), "", false) {
|
|
@@ -311,10 +309,14 @@ FROM
|
|
v["type"] = 3
|
|
v["type"] = 3
|
|
personName := gconv.String(v["name"])
|
|
personName := gconv.String(v["name"])
|
|
id := gconv.Int64(v["position_id"])
|
|
id := gconv.Int64(v["position_id"])
|
|
- if id == positionId && full {
|
|
|
|
|
|
+ if id == positionId && !full {
|
|
|
|
+ if personName == "孙鹏" {
|
|
|
|
+ v["orderStatus"] = 2
|
|
|
|
+ }
|
|
administrators = v
|
|
administrators = v
|
|
}
|
|
}
|
|
if personName == "孙鹏" {
|
|
if personName == "孙鹏" {
|
|
|
|
+ v["orderStatus"] = 2
|
|
administrators3 = v
|
|
administrators3 = v
|
|
proportion3 += 0.5
|
|
proportion3 += 0.5
|
|
} else {
|
|
} else {
|
|
@@ -327,10 +329,14 @@ FROM
|
|
v["type"] = 1
|
|
v["type"] = 1
|
|
personName := gconv.String(v["name"])
|
|
personName := gconv.String(v["name"])
|
|
id := gconv.Int64(v["position_id"])
|
|
id := gconv.Int64(v["position_id"])
|
|
- if id == positionId && full {
|
|
|
|
|
|
+ if id == positionId && !full {
|
|
|
|
+ if personName == "沈炳毅" {
|
|
|
|
+ v["orderStatus"] = 2
|
|
|
|
+ }
|
|
administrators = v
|
|
administrators = v
|
|
}
|
|
}
|
|
if personName == "沈炳毅" {
|
|
if personName == "沈炳毅" {
|
|
|
|
+ v["orderStatus"] = 2
|
|
administrators1 = v
|
|
administrators1 = v
|
|
proportion1 += 0.5
|
|
proportion1 += 0.5
|
|
} else {
|
|
} else {
|
|
@@ -340,6 +346,9 @@ FROM
|
|
allData = append(allData, v)
|
|
allData = append(allData, v)
|
|
}
|
|
}
|
|
if positionId != 0 {
|
|
if positionId != 0 {
|
|
|
|
+ if administrators == nil || len(administrators) == 0 {
|
|
|
|
+ return false, map[string]interface{}{}, allData
|
|
|
|
+ }
|
|
positiontype := gconv.Int64(administrators["type"])
|
|
positiontype := gconv.Int64(administrators["type"])
|
|
if full {
|
|
if full {
|
|
switch positiontype {
|
|
switch positiontype {
|
|
@@ -368,9 +377,9 @@ FROM
|
|
}
|
|
}
|
|
//按照比例分配选择一部还是三部
|
|
//按照比例分配选择一部还是三部
|
|
//一部查询
|
|
//一部查询
|
|
- deptCount1 := CalculateProportion(strings.Join(positionIdArr1, ","), "", 1)
|
|
|
|
|
|
+ deptCount1 := CalculateProportion(strings.Join(positionIdArr1, ","))
|
|
//三部查询
|
|
//三部查询
|
|
- deptCount3 := CalculateProportion(strings.Join(positionIdArr3, ","), "", 1)
|
|
|
|
|
|
+ deptCount3 := CalculateProportion(strings.Join(positionIdArr3, ","))
|
|
if deptCount1 == 0 {
|
|
if deptCount1 == 0 {
|
|
return true, administrators1, allData
|
|
return true, administrators1, allData
|
|
}
|
|
}
|
|
@@ -384,7 +393,19 @@ FROM
|
|
}
|
|
}
|
|
return false, map[string]interface{}{}, allData
|
|
return false, map[string]interface{}{}, allData
|
|
}
|
|
}
|
|
-func CalculateProportion(positionIsStr, createTime string, proportion float64) float64 {
|
|
|
|
|
|
+func CalculateProportion(positionIsStr string) float64 {
|
|
|
|
+ createtime := time.Time{}
|
|
|
|
+ now := time.Now()
|
|
|
|
+ weekday := int(now.Weekday())
|
|
|
|
+ if weekday == 0 { // 如果是周日,则将其视为本周的最后一天
|
|
|
|
+ weekday = 7
|
|
|
|
+ }
|
|
|
|
+ switch cfg.LoopType {
|
|
|
|
+ case 1: //周
|
|
|
|
+ createtime = now.AddDate(0, 0, -weekday+1)
|
|
|
|
+ case 2: //月
|
|
|
|
+ createtime = time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.Local)
|
|
|
|
+ }
|
|
count := float64(0)
|
|
count := float64(0)
|
|
sql := `SELECT
|
|
sql := `SELECT
|
|
sum(1) as count
|
|
sum(1) as count
|
|
@@ -394,7 +415,7 @@ func CalculateProportion(positionIsStr, createTime string, proportion float64) f
|
|
FIND_IN_SET(current_position_id ,?)
|
|
FIND_IN_SET(current_position_id ,?)
|
|
AND is_delete=1
|
|
AND is_delete=1
|
|
and creator_time>?`
|
|
and creator_time>?`
|
|
- data := WorkOrder.SelectBySql(sql, positionIsStr, createTime)
|
|
|
|
|
|
+ data := WorkOrder.SelectBySql(sql, positionIsStr, createtime.Format("2006-01-02"))
|
|
if data != nil && len(*data) > 0 {
|
|
if data != nil && len(*data) > 0 {
|
|
count = gconv.Float64((*data)[0]["count"])
|
|
count = gconv.Float64((*data)[0]["count"])
|
|
}
|
|
}
|