Store.ChangePriceType新增StoreChangePriceTypeManagedStore
This commit is contained in:
@@ -97,6 +97,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
"configTypeName": model.ConfigTypeName,
|
||||
"autoSaleAt": AutoSaleAtStr,
|
||||
"userTypeName": model.UserTypeName,
|
||||
"storePriceTypeName": model.StorePriceTypeName,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,7 +988,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
for _, v := range allBinds {
|
||||
var num int64
|
||||
inSkuBind := inSkuBinsMap[v.RealSkuID]
|
||||
isCanChangePrice := (isUserCanDirectChangePrice || v.ChangePriceType != model.StoreChangePriceTypeBossDisabled)
|
||||
isCanChangePrice := (isUserCanDirectChangePrice || jxutils.TranslateStorePriceType(v.ChangePriceType) != model.StoreChangePriceTypeBossDisabled)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(inSkuBind, false))
|
||||
var skuBind *model.StoreSkuBind
|
||||
if v.ID == 0 {
|
||||
@@ -1448,7 +1448,7 @@ func shouldPendingStorePriceChange(ctx *jxcontext.Context, storeID int, skuBindI
|
||||
if err = dao.GetEntity(db, store); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return store.ChangePriceType == model.StoreChangePriceTypeNeedApprove, nil
|
||||
return jxutils.TranslateStorePriceType(store.ChangePriceType) == model.StoreChangePriceTypeNeedApprove, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
|
||||
@@ -798,3 +798,10 @@ func Point2StoreDistance(lng, lat float64, intStoreLng, intStoreLat int, deliver
|
||||
}
|
||||
return distance
|
||||
}
|
||||
|
||||
func TranslateStorePriceType(storePriceType int8) int8 {
|
||||
if storePriceType == model.StoreChangePriceTypeManagedStore {
|
||||
storePriceType = model.StoreChangePriceTypeBossDisabled
|
||||
}
|
||||
return storePriceType
|
||||
}
|
||||
|
||||
@@ -43,9 +43,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
StoreChangePriceTypeDirect = 0
|
||||
StoreChangePriceTypeNeedApprove = 1
|
||||
StoreChangePriceTypeBossDisabled = 2
|
||||
StoreChangePriceTypeDirect = 0 // 普通门店
|
||||
StoreChangePriceTypeNeedApprove = 1 // 改价需要审核,暂时没用
|
||||
StoreChangePriceTypeBossDisabled = 2 // 完全禁止改价
|
||||
StoreChangePriceTypeManagedStore = 3 // 直营门店,禁止改价
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -234,6 +235,11 @@ var (
|
||||
StoreAuditStatusOnline: "上线",
|
||||
StoreAuditStatusRejected: "拒绝",
|
||||
}
|
||||
StorePriceTypeName = map[int]string{
|
||||
StoreChangePriceTypeDirect: "可直接改价",
|
||||
StoreChangePriceTypeBossDisabled: "禁止改价",
|
||||
StoreChangePriceTypeManagedStore: "直营门店",
|
||||
}
|
||||
)
|
||||
|
||||
type Store struct {
|
||||
@@ -258,12 +264,13 @@ type Store struct {
|
||||
AutoEnableAt *time.Time `orm:"type(datetime);null" json:"autoEnableAt"` // 自动营业时间(临时休息用)
|
||||
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
|
||||
SMSNotify int8 `orm:"column(sms_notify);" json:"smsNotify"` // 是否通过短信接收订单消息
|
||||
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
||||
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体-1:小,0:正常,1:大
|
||||
PrinterVendorID int `orm:"column(printer_vendor_id);" json:"printerVendorID"`
|
||||
PrinterSN string `orm:"size(32);column(printer_sn);index" json:"printerSN"`
|
||||
PrinterKey string `orm:"size(64)" json:"printerKey"`
|
||||
PrinterBindInfo string `orm:"size(1024)" json:"-"`
|
||||
|
||||
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
||||
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体-1:小,0:正常,1:大
|
||||
PrinterVendorID int `orm:"column(printer_vendor_id);" json:"printerVendorID"`
|
||||
PrinterSN string `orm:"size(32);column(printer_sn);index" json:"printerSN"`
|
||||
PrinterKey string `orm:"size(64)" json:"printerKey"`
|
||||
PrinterBindInfo string `orm:"size(1024)" json:"-"`
|
||||
|
||||
IDCardFront string `orm:"size(255);column(id_card_front)" json:"idCardFront"`
|
||||
IDCardBack string `orm:"size(255);column(id_card_back)" json:"idCardBack"`
|
||||
|
||||
Reference in New Issue
Block a user