aa
This commit is contained in:
@@ -1481,3 +1481,21 @@ func GetPriceDefendOrder(db *DaoDB, vendorOrderID string, storeIDs, skuIDs, issu
|
||||
err = GetRows(db, &priceDefendOrders, sql, sqlParams)
|
||||
return priceDefendOrders, err
|
||||
}
|
||||
|
||||
func GetCoupons(db *DaoDB, couponType int, keyword string) (coupons []*model.Coupons, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM coupons
|
||||
WHERE deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue}
|
||||
if couponType != 0 {
|
||||
sql += " AND coupon_type = ?"
|
||||
sqlParams = append(sqlParams, couponType)
|
||||
}
|
||||
if keyword != "" {
|
||||
sql += " AND (name LIKE ? OR desc LIKE ?)"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%", "%"+keyword+"%")
|
||||
}
|
||||
return coupons, err
|
||||
}
|
||||
|
||||
@@ -2150,9 +2150,9 @@ func GetMyPriceDefendOrders(ctx *jxcontext.Context, fromTime, toTime string) (pr
|
||||
}
|
||||
|
||||
func GetCoupons(ctx *jxcontext.Context, couponType int, keyword string) (coupons []*model.Coupons, err error) {
|
||||
// var (
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
// coupons, err = dao.GetCoupons(db, couponType, keyword)
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
coupons, err = dao.GetCoupons(db, couponType, keyword)
|
||||
return coupons, err
|
||||
}
|
||||
|
||||
@@ -700,6 +700,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetCoupons",
|
||||
Router: `/GetCoupons`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetMatterOrderStatus",
|
||||
|
||||
Reference in New Issue
Block a user