Explorar o código

Merge branch 'master' of http://8.136.199.33:3000/cxzhang/hongze_mfyx into debug

xingzai hai 9 meses
pai
achega
f4c82bb0a7
Modificáronse 2 ficheiros con 11 adicións e 7 borrados
  1. 10 6
      controllers/yanxuan_special.go
  2. 1 1
      services/wx_category_template_msg.go

+ 10 - 6
controllers/yanxuan_special.go

@@ -160,12 +160,12 @@ func (this *BaseAuthMobileController) Detail() {
 		this.ServeJSON()
 	}()
 	user := this.User
-	//if sysUser == nil {
-	//	br.Msg = "请登录"
-	//	br.ErrMsg = "请登录1,SysUser Is Empty"
-	//	br.Ret = 408
-	//	return
-	//}
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录1,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
 
 	specialId, _ := this.GetInt("Id", 0)
 	isSendWx, _ := this.GetInt("IsSendWx", 0)
@@ -269,6 +269,10 @@ func (this *BaseAuthMobileController) Detail() {
 		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		return
 	}
+	//看自己的文章时不设权限限制,不需要判断是否有研选订阅权限,都可以看。
+	if user.UserId == item.UserId {
+		havePower = true
+	}
 	var hasPermission int
 	if havePower {
 		hasPermission = 1

+ 1 - 1
services/wx_category_template_msg.go

@@ -942,7 +942,7 @@ func SendWxCategoryMsgWxPay(orderDetail *order.CygxOrder) (err error) {
 	}
 
 	if adminId > 0 {
-		adminDetail, e := models.GetSellerByAdminId(orderDetail.ShareId)
+		adminDetail, e := models.GetSellerByAdminId(adminId)
 		if e != nil {
 			err = errors.New("GetYanxuanSpecialFollowUserById, Err: " + e.Error())
 			return