|
@@ -24,11 +24,11 @@ type ParticipateStatistics struct {
|
|
EntUserId int64
|
|
EntUserId int64
|
|
}
|
|
}
|
|
|
|
|
|
-func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime, endTime int64) (result []*bxcore.PushStatisticsData) {
|
|
|
|
|
|
+func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime, endTime int64, source int64) (result []*bxcore.PushStatisticsData) {
|
|
//判断是企业、部门还是个人
|
|
//判断是企业、部门还是个人
|
|
isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
|
|
isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
|
|
//时间处理
|
|
//时间处理
|
|
- query := QueryHandle(isAdmin, startTime, endTime, personArrStr)
|
|
|
|
|
|
+ query := QueryHandle(isAdmin, startTime, endTime, personArrStr, source, -1)
|
|
//推送数据查询
|
|
//推送数据查询
|
|
dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select * from participate_push_statistics where %s order by ymd", strings.Join(query, " and ")))
|
|
dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select * from participate_push_statistics where %s order by ymd", strings.Join(query, " and ")))
|
|
if users != nil && len(*users) > 0 {
|
|
if users != nil && len(*users) > 0 {
|
|
@@ -37,10 +37,10 @@ func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func (in *ParticipateStatistics) ProjectStatistics(entUserIdArr []string, startTime, endTime int64) (result []*bxcore.ProjectStatisticsData) {
|
|
|
|
|
|
+func (in *ParticipateStatistics) ProjectStatistics(entUserIdArr []string, startTime, endTime, bidWay int64) (result []*bxcore.ProjectStatisticsData) {
|
|
//判断是企业、部门还是个人
|
|
//判断是企业、部门还是个人
|
|
isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
|
|
isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
|
|
- query := QueryHandle(isAdmin, startTime, endTime, personArrStr)
|
|
|
|
|
|
+ query := QueryHandle(isAdmin, startTime, endTime, personArrStr, -1, bidWay)
|
|
//订阅推送数处理
|
|
//订阅推送数处理
|
|
//推送数据查询
|
|
//推送数据查询
|
|
dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select * from participate_project_statistics where %s order by ymd", strings.Join(query, "and ")))
|
|
dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select * from participate_project_statistics where %s order by ymd", strings.Join(query, "and ")))
|
|
@@ -385,7 +385,7 @@ func DataHanle(data map[string]interface{}, project_id string) map[string]interf
|
|
}
|
|
}
|
|
return data
|
|
return data
|
|
}
|
|
}
|
|
-func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string) []string {
|
|
|
|
|
|
+func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string, source int64, bidWay int64) []string {
|
|
//时间处理
|
|
//时间处理
|
|
query := []string{}
|
|
query := []string{}
|
|
if isAdmin {
|
|
if isAdmin {
|
|
@@ -406,5 +406,11 @@ func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string) []
|
|
if endTime != 0 {
|
|
if endTime != 0 {
|
|
query = append(query, fmt.Sprintf(" ymd <= %d ", endTime))
|
|
query = append(query, fmt.Sprintf(" ymd <= %d ", endTime))
|
|
}
|
|
}
|
|
|
|
+ if source != -1 {
|
|
|
|
+ query = append(query, fmt.Sprintf("source = %d", source))
|
|
|
|
+ }
|
|
|
|
+ if bidWay != -1 {
|
|
|
|
+ query = append(query, fmt.Sprintf("bid_way = %d", bidWay))
|
|
|
|
+ }
|
|
return query
|
|
return query
|
|
}
|
|
}
|