This commit is contained in:
suyl
2021-06-08 10:30:09 +08:00
parent 2299750c68
commit 7065dc8cd4
2 changed files with 11 additions and 1 deletions

View File

@@ -5340,13 +5340,22 @@ func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSku
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeAudit := batchItemList[0].(*model.StoreSkuAudit)
if multiFlag {
var skuIDList []int
skuList, _ := dao.GetStoreSkusByNameIDs(db, []int{storeAudit.StoreID}, storeAudit.NameID)
if len(skuList) > 0 {
if int64(storeAudit.AuditPrice) > skuList[0].UnitPrice*2 {
return nil, fmt.Errorf("修改的价格超出原价格两倍请单个审核门店ID:[%v]商品nameID:[%v],商品名:[%v]", storeAudit.StoreID, storeAudit.NameID, skuList[0].Name)
}
for _, v := range skuList {
skuIDList = append(skuIDList, v.SkuID)
}
}
actList, _ := dao.QueryActs(db, 0, 0, 10, -1, "", -1, []int{model.ActStatusCreated},
[]int{model.ActSkuDirectDown, model.ActSkuSecKill, model.ActSkuDiscount}, nil, storeAudit.StoreID, skuIDList, 0,
time.Now().AddDate(0, -3, 0), time.Now(), utils.ZeroTimeValue, utils.ZeroTimeValue)
if len(actList.Data) > 0 {
return nil, fmt.Errorf("审核的商品正在做活动请单个审核活动ID:[%v]门店ID:[%v]商品nameID:[%v],商品名:[%v]", actList.Data[0].ID, storeAudit.StoreID, storeAudit.NameID, skuList[0].Name)
}
//dao.QueryActs(db, 0, 0, 10, -1, "", -1, []int{model.ActStatusCreated}, []int{model.ActSkuDirectDown, model.ActSkuSecKill, model.ActSkuDiscount})
}
storeAudits, err := dao.GetStoreSkuAuditLight(db, []int{storeAudit.StoreID}, []int{storeAudit.NameID}, model.StoreAuditStatusOnline)
if len(storeAudits) == 0 || err != nil {

View File

@@ -1933,6 +1933,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
}
}
}
return err
}