浏览代码

feat:打印日志

wangshan 2 年之前
父节点
当前提交
23b6e51093
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 2 0
      jyBXCore/rpc/model/mysql/participateBid.go
  2. 4 2
      jyBXCore/rpc/service/participate.go

+ 2 - 0
jyBXCore/rpc/model/mysql/participateBid.go

@@ -637,11 +637,13 @@ func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (
 	singlePersonSql += conditionSql
 	countSql := fmt.Sprintf(singlePersonSql, " COUNT(pt.id) ")
 	count := IC.BaseMysql.CountBySql(countSql, in.PositionId)
+	log.Println(countSql, "---", count)
 	if count > 0 {
 		data.Count = count
 		listSql := fmt.Sprintf(singlePersonSql, " pt.*,pbr.create_date ")
 		//分页
 		listSql += fmt.Sprintf(` LIMIT %d,%d`, in.PageNum, in.PageSize)
+		log.Println("listSql:", listSql)
 		list := IC.BaseMysql.SelectBySql(listSql, in.PositionId)
 		if list != nil && len(*list) > 0 {
 			for _, v := range *list {

+ 4 - 2
jyBXCore/rpc/service/participate.go

@@ -9,6 +9,7 @@ import (
 	"jyBXCore/rpc/model/mysql"
 	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/util"
+	"log"
 	"strconv"
 	"strings"
 	"time"
@@ -19,8 +20,8 @@ func ParticipateList(in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes,
 	defer MC.Catch()
 	res := &bxcore.ParticipateListRes{Data: &bxcore.ParticipateData{}}
 	b, entRoleId := util.IsAllowedParticipate(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntAccountId, in.EntId, in.EntUserId, in.PositionId, in.PositionType)
-	if !b {
-		res.ErrCode = -1
+	if !b || (in.Identity == "ent" && entRoleId == 0) {
+		res.ErrCode = 0
 		res.ErrMsg = "没有权限"
 		return res, nil
 	}
@@ -36,6 +37,7 @@ func ParticipateList(in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes,
 	if in.PageSize < 1 {
 		in.PageSize = 10
 	}
+	log.Println(in.PageNum, "------", in.PageSize)
 	switch in.Identity {
 	case "mine": //员工|个人列表
 		r, e := mysql.SingleParticipateList(in, mysql.ParticipateListSql(in))