|
|
@@ -57,6 +57,9 @@ type UserBusinessAnalysis struct { |
|
|
|
|
|
|
|
//user |
|
|
|
Email string `xorm:"NOT NULL"` |
|
|
|
|
|
|
|
//user |
|
|
|
Name string `xorm:"NOT NULL"` |
|
|
|
} |
|
|
|
|
|
|
|
func countData() { |
|
|
@@ -92,6 +95,7 @@ func countData() { |
|
|
|
dateRecord.CountDate = CountDate.Unix() |
|
|
|
dateRecord.Email = userRecord.Email |
|
|
|
dateRecord.RegistDate = userRecord.CreatedUnix |
|
|
|
dateRecord.Name = userRecord.Name |
|
|
|
|
|
|
|
if _, ok := CodeMergeCountMap[dateRecord.ID]; !ok { |
|
|
|
dateRecord.CodeMergeCount = 0 |
|
|
@@ -119,11 +123,11 @@ func countData() { |
|
|
|
func queryAction(start_unix int64, end_unix int64, actionType int64) map[int64]int { |
|
|
|
sess := x.NewSession() |
|
|
|
defer sess.Close() |
|
|
|
sess.Select("id,user_id,op_type,act_user_id").Table("action").Where("op_type=" + fmt.Sprint(actionType) + " and create_unix>=" + fmt.Sprint(start_unix) + " and create_unix<=" + fmt.Sprint(end_unix)) |
|
|
|
sess.Select("id,user_id,op_type,act_user_id").Table("action").Where("op_type=" + fmt.Sprint(actionType) + " and created_unix>=" + fmt.Sprint(start_unix) + " and created_unix<=" + fmt.Sprint(end_unix)) |
|
|
|
actionList := make([]*Action, 0) |
|
|
|
sess.Find(&actionList) |
|
|
|
resultMap := make(map[int64]int) |
|
|
|
|
|
|
|
log.Info("query action size=" + fmt.Sprint(len(actionList))) |
|
|
|
for _, actionRecord := range actionList { |
|
|
|
if _, ok := resultMap[actionRecord.UserID]; !ok { |
|
|
|
resultMap[actionRecord.UserID] = 1 |
|
|
|