- 修复SendAlarmVendorSnapshot调用GetUsers时,防止roleUserIDList为空的bug

This commit is contained in:
gazebo
2019-09-10 15:22:15 +08:00
parent fb8732c94c
commit cc750af2ca

View File

@@ -1580,10 +1580,10 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p
storeDetailMap[storeID] = storeDetail
var userList []*model.User
if roleUserIDList, err := GetRoleUserList(ctx, autils.NewStoreBossRole(storeID)); err == nil {
if roleUserIDList, err := GetRoleUserList(ctx, autils.NewStoreBossRole(storeID)); err == nil && len(roleUserIDList) > 0 {
userList, _, _ = dao.GetUsers(db, 0, "", roleUserIDList, "", "", 0, -1)
}
for _, mobile := range []string{storeDetail.Tel1, storeDetail.MarketManPhone, storeDetail.OperatorPhone} {
for _, mobile := range []string{storeDetail.Tel1, storeDetail.Tel2, storeDetail.MarketManPhone, storeDetail.OperatorPhone} {
if mobile != "" {
if user, err2 := dao.GetUserByID(db, "mobile", mobile); err2 == nil {
userList = append(userList, user)