Browse Source

no message

xingzai 1 year ago
parent
commit
f06dcf64c1

+ 16 - 9
controllers/activity.go

@@ -536,16 +536,23 @@ func (this *ActivityCoAntroller) Detail() {
 		//处理按钮是否展示问题
 		resp.Detail = services.ActivityButtonShow(activityInfo)
 	} else {
-		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermissionActivity(user, activityInfo)
-		if err != nil {
-			br.Msg = "获取信息失败"
-			br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-			return
+		//用户未登录(绑定登录信息)的时候也能展示 v12.2.1
+		if user.UserId == 0 {
+			resp.HasPermission = 1
+			resp.Detail = services.ActivityButtonShow(activityInfo)
+		} else {
+			hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermissionActivity(user, activityInfo)
+			if err != nil {
+				br.Msg = "获取信息失败"
+				br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
+				return
+			}
+			resp.PopupMsg = popupMsg
+			resp.HasPermission = hasPermission
+			resp.SellerName = sellerName
+			resp.SellerMobile = sellerMobile
 		}
-		resp.PopupMsg = popupMsg
-		resp.HasPermission = hasPermission
-		resp.SellerName = sellerName
-		resp.SellerMobile = sellerMobile
+
 	}
 
 	collectCount1, err := models.GetActivityVoiceCollectCount(uid, activityId)

+ 2 - 3
controllers/home.go

@@ -844,9 +844,8 @@ func (this *HomeController) NewList() {
 
 	//conditionInit += `  AND source IN ('newchart')`
 	if user.CompanyId <= 1 || totalRai == 0 {
-		condition += " AND source IN ('roadshow','article') "
-		startSize = 0
-		pageSize = 4
+		//condition += " AND source IN ('roadshow','article') "
+		condition += " AND source NOT IN ('activityspecial') "
 	} else {
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
 		//conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)

+ 3 - 0
controllers/morning_meeting.go

@@ -127,6 +127,9 @@ func (this *MorningMeetingController) GatherDetail() {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取用户权限信息失败,Err:" + err.Error()
 	}
+	if user.UserId == 0 {
+		hasPermission = 1 //用户未登录(绑定登录信息)的时候也能展示 v12.2.1
+	}
 	resp.HasPermission = hasPermission
 	if hasPermission != 1 {
 		br.Ret = 200

+ 5 - 0
controllers/product_interior.go

@@ -107,6 +107,11 @@ func (this *ProductInteriorController) Detail() {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取用户权限信息失败,Err:" + err.Error()
 	}
+
+	if user.UserId == 0 {
+		hasPermission = 1 //用户未登录(绑定登录信息)的时候也能展示 v12.2.1
+	}
+
 	//未设置全部可见的只能给弘则内部查看
 	if detail.VisibleRange == 1 || user.CompanyId == utils.HZ_COMPANY_ID {
 		resp.IsShow = true

+ 6 - 1
services/activity.go

@@ -1180,6 +1180,11 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 
 // 根据用户身份处理活动可见
 func ActivityConditioninitSql(user *models.WxUserItem, condition string, isPower int) (conditionActivity string, err error) {
+	//未登录的用户也可以查看所有活动v12.2.1
+	if user.UserId == 0 {
+		conditionActivity = ` AND art.publish_status = 1  `
+		return
+	}
 	// cygx_10.9 未绑定联系方式的客户可以看到部分活动
 	if user.UserId == 0 || user.CompanyId == 1 {
 		conditionActivity = ` AND art.publish_status = 1  AND art.visible_range != 1 AND (art.is_limit_people = 0 OR (art.is_limit_people=1 AND art.is_all_customer_type=1))   ` + condition
@@ -1188,7 +1193,7 @@ func ActivityConditioninitSql(user *models.WxUserItem, condition string, isPower
 	condition += `   AND art.publish_status = 1 `
 	conditionActivity = condition
 	//弘则可以查看所有活动
-	if GetBelongingRai(user.Mobile) && user.CompanyId == utils.HZ_COMPANY_ID {
+	if (GetBelongingRai(user.Mobile) && user.CompanyId == utils.HZ_COMPANY_ID) || user.UserId == 0 {
 		return
 	}
 	adminIds, err := models.GetSelleridWhichGroup(user.CompanyId, 2)