|
|
@@ -11,8 +11,19 @@ import ( |
|
|
|
|
|
|
|
func UserInfo(c *gin.Context) { |
|
|
|
store := svc.GetCampStore(c) |
|
|
|
|
|
|
|
role := []string{"comm"} |
|
|
|
user := store |
|
|
|
if store.Pid > 0 { |
|
|
|
NewCampTaskStoreUserDb := implement.NewCampTaskStoreUserDb(svc.MasterDb(c)) |
|
|
|
user, _ = NewCampTaskStoreUserDb.GetCampTaskStoreUser(store.Pid) |
|
|
|
} else { |
|
|
|
role = append(role, "director") |
|
|
|
} |
|
|
|
if user.IsShowProject == 1 { |
|
|
|
role = append(role, "project") |
|
|
|
} |
|
|
|
res := map[string]interface{}{ |
|
|
|
"role": role, |
|
|
|
"phone": store.Phone, |
|
|
|
} |
|
|
|
e.OutSuc(c, res, nil) |
|
|
@@ -20,6 +31,7 @@ func UserInfo(c *gin.Context) { |
|
|
|
} |
|
|
|
func Index(c *gin.Context) { |
|
|
|
storeId := svc.GetCampStoreId(c) |
|
|
|
//TODO 要根据账号 |
|
|
|
allTaskCount, _ := svc.MasterDb(c).Where("store_id=? and is_delete=0", storeId).Count(&models.CampTaskList{}) |
|
|
|
orderCount, _ := svc.MasterDb(c).Where("store_id=? and state=1", storeId).Count(&models.CampTaskUserPromotionOrder{}) |
|
|
|
settleCount, _ := svc.MasterDb(c).Where("store_id=? and settle_time is not null", storeId).Sum(&models.CampTaskUserPromotionOrder{}, "payment") |
|
|
|