- change isLock from bool to int for LockPromotionSkus
This commit is contained in:
@@ -801,20 +801,19 @@ func RefreshJdPromotionLockStatus(promotionID int) (err error) {
|
||||
return RefreshJdPromotionItemListLockStatus(promotionItemList)
|
||||
}
|
||||
|
||||
func LockPromotionSkus(ctx *jxcontext.Context, promotionID int, isLock bool, skuIDs []int) (num int64, err error) {
|
||||
func LockPromotionSkus(ctx *jxcontext.Context, promotionID int, isLock int, skuIDs []int) (num int64, err error) {
|
||||
globals.SugarLogger.Debugf("LockPromotionSkus promotionID:%d, isLock:%t, skuIDs:%v", promotionID, isLock, skuIDs)
|
||||
if isLock != 0 {
|
||||
isLock = 1
|
||||
}
|
||||
|
||||
sql := `
|
||||
UPDATE promotion_sku t1
|
||||
SET t1.is_lock = ?
|
||||
WHERE t1.promotion_id = ?
|
||||
`
|
||||
intIsLock := 0
|
||||
if isLock {
|
||||
intIsLock = 1
|
||||
}
|
||||
sqlParams := []interface{}{
|
||||
intIsLock,
|
||||
isLock,
|
||||
promotionID,
|
||||
}
|
||||
if len(skuIDs) > 0 {
|
||||
@@ -825,7 +824,7 @@ func LockPromotionSkus(ctx *jxcontext.Context, promotionID int, isLock bool, sku
|
||||
num, err = dao.ExecuteSQL(db, sql, sqlParams...)
|
||||
if err == nil {
|
||||
RefreshJdPromotionLockStatus(promotionID)
|
||||
if isLock {
|
||||
if isLock != 0 {
|
||||
RefreshJdStoreSkuStock()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ func (c *PromotionController) CancelPromotion() {
|
||||
// @Description 锁定解锁活动SKU
|
||||
// @Param token header string true "认证token"
|
||||
// @Param promotionID formData int true "活动id"
|
||||
// @Param isLock formData bool true "活动id"
|
||||
// @Param isLock formData int true "锁定标志,0:不锁定,1:锁定"
|
||||
// @Param skuIDs formData string false "缺省全部"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
|
||||
Reference in New Issue
Block a user