xingzai пре 1 година
родитељ
комит
c4a03a717f
2 измењених фајлова са 5 додато и 6 уклоњено
  1. 4 3
      controllers/user.go
  2. 1 3
      models/user_record.go

+ 4 - 3
controllers/user.go

@@ -656,13 +656,14 @@ func (this *UserController) ApplyTryOut() {
 		}
 	} else {
 		//获取销售信息
-		sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
-		if err != nil && err.Error() != utils.ErrNoRow() {
+		//sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
+		ficcCount, err := models.GetCompanyProductCount(user.CompanyId, utils.COMPANY_PRODUCT_FICC_ID)
+		if err != nil {
 			br.Msg = "申请失败"
 			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
 			return
 		}
-		if sellerItem != nil {
+		if ficcCount > 0 {
 			CompanyIdType = 3
 			applyMethod = "FICC客户"
 			categoryApplyMethod = "FICC客户"

+ 1 - 3
models/user_record.go

@@ -163,7 +163,6 @@ func GetUserRecordListByMobile(platform int, bindAccount string) (items []*OpenI
 	return
 }
 
-
 // 根据手机号获取用户的openid
 func GetMfyxUserRecordListByMobile(platform int, bindAccount string) (items []*OpenIdList, err error) {
 	var sql string
@@ -177,7 +176,6 @@ func GetMfyxUserRecordListByMobile(platform int, bindAccount string) (items []*O
 	return
 }
 
-
 func GetMfyxWxOpenIdByMobileList(mobile string) (items []*OpenIdList, err error) {
 	sliceMobile := strings.Split(mobile, ",")
 	var mobiles []string
@@ -231,4 +229,4 @@ func GetMfyxWxOpenIdByMobileSliceList(mobiles []string) (items []*OpenIdList, er
 			1 = 1  ` + condition
 	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
-}
+}