作者 yangfu

统计修改

@@ -779,3 +779,15 @@ from ( @@ -779,3 +779,15 @@ from (
779 } 779 }
780 return 780 return
781 } 781 }
  782 +
  783 +// 机会数量统计按审核状态
  784 +func GetChanceMyChanceCountByReviewStatus(uid, cid int64, reviewStatus []int8) (total int, err error) {
  785 + //update_at
  786 + sqlCount := fmt.Sprintf(`select count(0) from chance
  787 +where user_id=? and company_id=? and review_status in (%v) and status=1 and enable_status=1
  788 +`, utils.JoinInt8s(reviewStatus, ","))
  789 + if err = utils.ExecuteQueryOne(&total, sqlCount, uid, cid); err != nil {
  790 + return
  791 + }
  792 + return
  793 +}
@@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
10 //我的机会 10 //我的机会
11 func MyChanceStatic(header *protocol.RequestHeader, reviewStatus ...int8) (total int, err error) { 11 func MyChanceStatic(header *protocol.RequestHeader, reviewStatus ...int8) (total int, err error) {
12 var () 12 var ()
13 - if total, err = models.GetChanceMyChance(header.UserId, header.CompanyId, reviewStatus, 0, 0, nil); err != nil { 13 + if total, err = models.GetChanceMyChanceCountByReviewStatus(header.UserId, header.CompanyId, reviewStatus); err != nil {
14 if err == orm.ErrNoRows { 14 if err == orm.ErrNoRows {
15 err = nil 15 err = nil
16 return 16 return