1234567891011121314151617181920212223242526272829303132333435363738 |
- package order
- import (
- "github.com/beego/beego/v2/client/orm"
- //"time"
- )
- type CygxGoods struct {
- GoodsId int `description:"商品ID"`
- GoodsName string `description:"商品名称"`
- Price float64 `description:"商品原价格"`
- CurrentPrice float64 `description:"商品现价(当时出售的价格)"`
- }
- type CygxGoodsResp struct {
- GoodsId int `description:"商品ID"`
- GoodsName string `description:"商品名称"`
- Price string `description:"商品原价格"`
- CurrentPrice string `description:"商品现价(当时出售的价格)"`
- PopupPriceMsg string `description:"价格弹窗信息"`
- }
- func GetCygxGoodsList(condition string, pars []interface{}) (item []*CygxGoodsResp, err error) {
- o := orm.NewOrm()
- sql := `SELECT *
- FROM
- cygx_goods
- WHERE 1 = 1 ` + condition
- _, err = o.Raw(sql, pars).QueryRows(&item)
- return
- }
- func GetCygxGoodsDetailByGoodsId(goodsId int) (item *CygxGoods, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_goods WHERE goods_id = ? `
- err = o.Raw(sql, goodsId).QueryRow(&item)
- return
- }
|