Commit ff28be91 authored by chenweijian's avatar chenweijian

派对申请

parent 8e972860
...@@ -68,9 +68,9 @@ func IsInInviteApply(model *domain.Model, userId mysql.ID) (bool, error) { ...@@ -68,9 +68,9 @@ func IsInInviteApply(model *domain.Model, userId mysql.ID) (bool, error) {
} }
// 检查被邀请人是否存在 // 检查被邀请人是否存在
func GetInviteApplyNumByType(model *domain.Model, gType int, beginTime, endTime time.Time, userIds []uint64) (int, error) { func GetInviteApplyNumByType(model *domain.Model, gType int, beginTime, endTime time.Time, userIds []uint64, subUserId uint64) (int, error) {
var count int64 var count int64
db := model.Db.Model(InviteApply{}).Where("user_id in (?)", userIds).Where("created_time >= ? and created_time <= ?", beginTime, endTime) db := model.Db.Model(InviteApply{}).Where("user_id in (?) or sub_user_id = ?", userIds, subUserId).Where("created_time >= ? and created_time <= ?", beginTime, endTime)
switch gType { // 1.已申请2.待审核3.已通过4.已拒绝 switch gType { // 1.已申请2.待审核3.已通过4.已拒绝
case 2: case 2:
db = db.Where("`status` = ?", 0) db = db.Where("`status` = ?", 0)
......
...@@ -176,7 +176,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -176,7 +176,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
} }
numList := make([]*invite_cv.InviteApplyNumRes, 0, 4) numList := make([]*invite_cv.InviteApplyNumRes, 0, 4)
for _, gType := range []int{1, 2, 3, 4} { // 1.已申请2.待审核3.已通过4.已拒绝 for _, gType := range []int{1, 2, 3, 4} { // 1.已申请2.待审核3.已通过4.已拒绝
num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime, agentIds) num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime, agentIds, userId)
if err != nil { if err != nil {
return myCtx, err return myCtx, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment