|
|
|
@ -3,9 +3,6 @@ package activebit
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
mysql2 "git.oa00.com/go/mysql"
|
|
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"path/filepath"
|
|
|
|
|
"recook/internal/back"
|
|
|
|
|
"recook/internal/libs/bean"
|
|
|
|
@ -17,7 +14,12 @@ import (
|
|
|
|
|
manage "recook/internal/v2/model/third"
|
|
|
|
|
"recook/tools"
|
|
|
|
|
"reflect"
|
|
|
|
|
"strconv"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
mysql2 "git.oa00.com/go/mysql"
|
|
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ControllerActive struct {
|
|
|
|
@ -115,8 +117,8 @@ func (a ControllerActive) ActivityList(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
rest, total := activebit.LogicActiveBit.ShowActivityList(p.IsType)
|
|
|
|
|
back.Suc(c, "ok", bean.ResultLists{
|
|
|
|
|
rest,
|
|
|
|
|
int(total),
|
|
|
|
|
List: rest,
|
|
|
|
|
Total: int(total),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -175,7 +177,9 @@ func (a ControllerActive) AddRecommend(c *gin.Context) {
|
|
|
|
|
//存入 1高佣 2特惠
|
|
|
|
|
status, _ := c.GetPostForm("status")
|
|
|
|
|
|
|
|
|
|
err = activebit.LogicActiveBit.AddCommends(result, status)
|
|
|
|
|
isSale, _ := c.GetPostForm("is_sale")
|
|
|
|
|
is_sale, _ := strconv.Atoi(isSale)
|
|
|
|
|
err = activebit.LogicActiveBit.AddCommends(result, status, is_sale == 1)
|
|
|
|
|
if err != nil {
|
|
|
|
|
back.Fail(c, err.Error())
|
|
|
|
|
return
|
|
|
|
@ -185,6 +189,7 @@ func (a ControllerActive) AddRecommend(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
type listReq struct {
|
|
|
|
|
Status uint `json:"status"`
|
|
|
|
|
IsSale bool `json:"is_sale"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a ControllerActive) List(c *gin.Context) {
|
|
|
|
@ -198,7 +203,8 @@ func (a ControllerActive) List(c *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
var list []recommendedlist.RecookCommendList
|
|
|
|
|
mysql2.Db.Table((&recommendedlist.RecookCommendList{}).TableName()).Where("status=?", p.Status).Find(&list)
|
|
|
|
|
mysql2.Db.Table((&recommendedlist.RecookCommendList{}).TableName()).
|
|
|
|
|
Where("is_sale=?", p.IsSale).Where("status=?", p.Status).Find(&list)
|
|
|
|
|
back.Suc(c, "", list)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|