|
@@ -462,12 +462,15 @@ func BannerList(c *gin.Context) {
|
|
|
isHomepage, _ := strconv.Atoi(c.Query("is_homepage"))
|
|
|
page, _ := strconv.Atoi(c.Query("page"))
|
|
|
limit, _ := strconv.Atoi(c.Query("limit"))
|
|
|
+ banner_type, _ := strconv.Atoi(c.Query("banner_type"))
|
|
|
cond := " enable = 1 "
|
|
|
|
|
|
if isHomepage != 1 {
|
|
|
cond += " AND remark <> '调研合集' "
|
|
|
}
|
|
|
|
|
|
+ cond += " AND banner_type = " + strconv.Itoa(banner_type)
|
|
|
+
|
|
|
list, err := banner.GetBannerList(cond, page, limit)
|
|
|
if err != nil {
|
|
|
response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
@@ -491,9 +494,12 @@ func BannerList(c *gin.Context) {
|
|
|
func BannerHistoryList(c *gin.Context) {
|
|
|
page, _ := strconv.Atoi(c.Query("page"))
|
|
|
limit, _ := strconv.Atoi(c.Query("limit"))
|
|
|
+ banner_type, _ := strconv.Atoi(c.Query("banner_type"))
|
|
|
cond := ""
|
|
|
cond += " enable = 0 "
|
|
|
|
|
|
+ cond += " AND banner_type = " + strconv.Itoa(banner_type)
|
|
|
+
|
|
|
total, err := banner.GetBannerListCount(cond)
|
|
|
if err != nil {
|
|
|
response.FailMsg("获取失败", "获取banner总数失败, Err: "+err.Error(), c)
|
|
@@ -553,6 +559,17 @@ func BannerGetQRCode(c *gin.Context) {
|
|
|
response.Ok(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ bannerItem, err := banner.GetBannerById(bannerId)
|
|
|
+ if err != nil {
|
|
|
+ response.Ok(err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if bannerItem.BannerType == 1 {
|
|
|
+ response.Ok(`无需扫码`, c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
companyInfo, tmpErr := company.GetByCompanyId(wxUserInfo.CompanyID)
|
|
|
if tmpErr != nil {
|
|
|
err = tmpErr
|