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