diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index d168b74b9..40a778a67 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -534,7 +534,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa valid := dao.StrictMakeMapByStructObject(payload, store, userName) if globals.EnableWXAuth2 { - if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["OperatorRole"])); err != nil { + if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["operatorRole"]), utils.Interface2String(valid["operatorRole2"])); err != nil { return 0, err } } @@ -716,7 +716,7 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i } db := dao.GetDB() if globals.EnableWXAuth2 { - if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil { + if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole, store.OperatorRole2); err != nil { return 0, err } } diff --git a/business/model/dao/dao_user.go b/business/model/dao/dao_user.go index 40b66bbc3..56f1a9a5f 100644 --- a/business/model/dao/dao_user.go +++ b/business/model/dao/dao_user.go @@ -168,8 +168,9 @@ func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, shortRoleNameList sqlParams = append(sqlParams, mobile, mobile) } if len(shortRoleNameList) > 0 { - sql += " OR t1.market_man_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ") OR t1.operator_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ")" - sqlParams = append(sqlParams, shortRoleNameList, shortRoleNameList) + questionMarks := GenQuestionMarks(len(shortRoleNameList)) + sql += " OR t1.market_man_role IN (" + questionMarks + ") OR t1.operator_role IN (" + questionMarks + ") OR t1.operator_role2 IN (" + questionMarks + ")" + sqlParams = append(sqlParams, shortRoleNameList, shortRoleNameList, shortRoleNameList) } if len(storeIDs) > 0 { sql += " OR t1.id IN (" + GenQuestionMarks(len(storeIDs)) + ")" diff --git a/business/model/dao/store.go b/business/model/dao/store.go index 5bdfde614..02655660f 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -435,11 +435,12 @@ func GetStoreList4Role(db *DaoDB, shortRoleName string) (storeList []*model.Stor sql := ` SELECT t1.* FROM store t1 - WHERE t1.deleted_at = ? AND (t1.market_man_role = ? OR t1.operator_role = ?)` + WHERE t1.deleted_at = ? AND (t1.market_man_role = ? OR t1.operator_role = ? OR t1.operator_role2 = ?)` sqlParams := []interface{}{ utils.DefaultTimeValue, shortRoleName, shortRoleName, + shortRoleName, } err = GetRows(db, &storeList, sql, sqlParams...) return storeList, err diff --git a/business/model/store.go b/business/model/store.go index d5cce5e2d..ab85c8ffc 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -256,6 +256,7 @@ type Store struct { ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核 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"` @@ -299,7 +300,8 @@ type Store struct { OperatorName string `orm:"size(8)" json:"operatorName"` // 运营人姓名 OperatorPhone string `orm:"size(16)" json:"operatorPhone"` // 运营人电话 - OperatorRole string `orm:"size(32)" json:"operatorRole"` // 运营人组(角色) + OperatorRole string `orm:"size(32)" json:"operatorRole"` // 京东运营人组(角色) + OperatorRole2 string `orm:"size(32)" json:"operatorRole2"` // 非京东运营人组(角色) } func (*Store) TableUnique() [][]string { @@ -309,7 +311,7 @@ func (*Store) TableUnique() [][]string { } func (s *Store) IsPrinterDisabled() bool { - return s.PrinterDisabled != 0 + return s.PrinterDisabled == 1 } func (s *Store) GetOpTimeList() (opTimeList []int16) {