添加招标信息,修改小程序用户登录商品列表
This commit is contained in:
37
business/bidding/bidding.go
Normal file
37
business/bidding/bidding.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package bidding
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
)
|
||||
|
||||
// 获取招标信息
|
||||
func GetBiddingMsg(ctx *jxcontext.Context, param map[string]interface{}) (result []*model.BiddingInfo, err error) {
|
||||
sql := `select * from cg a where 1=1`
|
||||
|
||||
sqlParam := make([]interface{}, 0)
|
||||
if param["title"] != nil {
|
||||
sql += " and a.title like ?"
|
||||
sqlParam = append(sqlParam, "%"+utils.Interface2String(param["title"])+"%")
|
||||
}
|
||||
if param["startTime"] != nil {
|
||||
sql += " and a.cg_time > ?"
|
||||
sqlParam = append(sqlParam, utils.Interface2String(param["startTime"]))
|
||||
}
|
||||
if param["endTime"] != nil {
|
||||
sql += " and a.cg_time <= ?"
|
||||
sqlParam = append(sqlParam, utils.Interface2String(param["endTime"]))
|
||||
}
|
||||
if param["pageSize"] != nil && param["pageNumber"] != nil {
|
||||
sql += " ORDER BY a.cg_time desc limit ? offset ? "
|
||||
sqlParam = append(sqlParam, param["pageSize"])
|
||||
sqlParam = append(sqlParam, (utils.MustInterface2Int64(param["pageNumber"])-1)*utils.MustInterface2Int64(param["pageSize"]))
|
||||
}
|
||||
|
||||
if err := dao.GetRows(dao.GetDB(), &result, sql, sqlParam...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -881,8 +881,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
}
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
beginTime := time.Now()
|
||||
fmt.Println("long=================================sql", sql)
|
||||
fmt.Println("long============================paramter", sqlParams)
|
||||
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
|
||||
10
business/model/bidding.go
Normal file
10
business/model/bidding.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type BiddingInfo struct {
|
||||
ID int64 `orm:"column(id)" json:"id"`
|
||||
Title string `orm:"size(512);column(title)" json:"title"`
|
||||
CgUrl string `orm:"size(512);column(cg_url)" json:"cgUrl"`
|
||||
CgTime time.Time `orm:"cg_time;type(datetime)" json:"cgTime"`
|
||||
}
|
||||
28
controllers/bidding.go
Normal file
28
controllers/bidding.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/bidding"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
)
|
||||
|
||||
type BiddingController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// @Title 获取招标信息
|
||||
// @Description 获取招标信息
|
||||
// @Param token header string false "认证token"
|
||||
// @Param title query string false "标题"
|
||||
// @Param startTime query string false "开始时间"
|
||||
// @Param endTime query string false "结束时间"
|
||||
// @Param pageSize query int false "页数"
|
||||
// @Param pageNumber query int false "页码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetBiddingMsg [get]
|
||||
func (c *BiddingController) GetBiddingMsg() {
|
||||
c.callGetBiddingMsg(func(params *tBindGetBiddingMsgParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = bidding.GetBiddingMsg(params.Ctx, params.MapData)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
@@ -71,6 +71,7 @@ func Init() {
|
||||
orm.RegisterModel(&model.OperateEvent{})
|
||||
orm.RegisterModel(&model.OperateEventDetail{})
|
||||
orm.RegisterModel(&model.SecretNumber{})
|
||||
orm.RegisterModel(&model.BiddingInfo{})
|
||||
|
||||
// orm.RegisterModel(&model.ActivityForSku{})
|
||||
// orm.RegisterModel(&legacymodel.JxBadComments2{})
|
||||
|
||||
@@ -4005,4 +4005,13 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||
web.ControllerComments{
|
||||
Method: "GetBiddingMsg",
|
||||
Router: `/GetBiddingMsg`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
}
|
||||
|
||||
@@ -151,6 +151,11 @@ func init() {
|
||||
&controllers.KnowController{},
|
||||
),
|
||||
),
|
||||
web.NSNamespace("/bind",
|
||||
web.NSInclude(
|
||||
&controllers.BiddingController{},
|
||||
),
|
||||
),
|
||||
)
|
||||
web.AddNamespace(ns)
|
||||
|
||||
@@ -171,6 +176,7 @@ func init() {
|
||||
web.AutoRouter(&controllers.FnController{})
|
||||
web.AutoRouter(&controllers.KnowUploadController{})
|
||||
web.AutoRouter(&controllers.AliApiController{})
|
||||
web.AutoRouter(&controllers.BiddingController{})
|
||||
|
||||
// 如下都是用于检测存活的空接口
|
||||
web.Any("/", func(ctx *beecontext.Context) {
|
||||
|
||||
Reference in New Issue
Block a user