+ Store添加MarketManRole与OperatorRole
- GetStoreListByMobileOrStoreIDs支持按Store.MarketManRole与OperatorRole来得到门店列表
This commit is contained in:
@@ -154,7 +154,7 @@ func GetStoreListByMobile(db *DaoDB, mobile string) (storeList []*StoreWithCityN
|
||||
return storeList, err
|
||||
}
|
||||
|
||||
func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, storeIDs []int) (storeList []*StoreWithCityName, err error) {
|
||||
func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, shortRoleNameList []string, storeIDs []int) (storeList []*StoreWithCityName, err error) {
|
||||
sql := `
|
||||
SELECT t1.*, t2.name city_name
|
||||
FROM store t1
|
||||
@@ -167,6 +167,10 @@ func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, storeIDs []int) (s
|
||||
sql += " OR t1.market_man_phone = ? OR t1.operator_phone = ?"
|
||||
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)
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " OR t1.id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
|
||||
@@ -284,10 +284,12 @@ type Store struct {
|
||||
Licence2Valid string `orm:"size(32)" json:"licence2Valid"` // 有效期开始
|
||||
Licence2Expire string `orm:"size(32)" json:"licence2Expire"` // 有效期结束
|
||||
|
||||
MarketManName string `orm:"size(8)" json:"marketManName"` // 市场负责人姓名
|
||||
MarketManPhone string `orm:"size(16)" json:"marketManPhone"` // 市场负责人电话
|
||||
JxBrandFeeFactor int `json:"jxBrandFeeFactor"` // 京西品牌费因子
|
||||
MarketAddFeeFactor int `json:"marketAddFeeFactor"` // 市场附加费因子
|
||||
MarketManName string `orm:"size(8)" json:"marketManName"` // 市场负责人姓名
|
||||
MarketManPhone string `orm:"size(16)" json:"marketManPhone"` // 市场负责人电话
|
||||
MarketManRole string `orm:"size(32)" json:"marketManRole"` // 市场负责人组(角色)
|
||||
|
||||
JxBrandFeeFactor int `json:"jxBrandFeeFactor"` // 京西品牌费因子
|
||||
MarketAddFeeFactor int `json:"marketAddFeeFactor"` // 市场附加费因子
|
||||
|
||||
PayeeName string `orm:"size(8)" json:"payeeName"` // 收款人姓名
|
||||
PayeeAccountNo string `orm:"size(255)" json:"payeeAccountNo"` // 收款账号
|
||||
@@ -297,6 +299,7 @@ type Store struct {
|
||||
|
||||
OperatorName string `orm:"size(8)" json:"operatorName"` // 运营人姓名
|
||||
OperatorPhone string `orm:"size(16)" json:"operatorPhone"` // 运营人电话
|
||||
OperatorRole string `orm:"size(32)" json:"operatorRole"` // 运营人组(角色)
|
||||
}
|
||||
|
||||
func (*Store) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user