This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
)
|
||||
|
||||
// RecipientResolver 按店铺当前独立归属解析主账号和可用平台业务员。
|
||||
// RecipientResolver 按店铺当前独立归属解析店铺账号和可用平台业务员。
|
||||
type RecipientResolver struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
@@ -25,7 +25,7 @@ func NewRecipientResolver(db *gorm.DB) *RecipientResolver {
|
||||
return &RecipientResolver{db: db}
|
||||
}
|
||||
|
||||
// ResolveNotificationRecipients 返回启用的店铺主账号和当前可用业务员账号 ID。
|
||||
// ResolveNotificationRecipients 返回全部启用的店铺账号和当前可用业务员账号 ID。
|
||||
//
|
||||
// 解析只读取目标店铺当前保存的业务员 ID,不读取父店铺、祖先店铺或创建人。
|
||||
func (r *RecipientResolver) ResolveNotificationRecipients(ctx context.Context, shopID uint) ([]uint, error) {
|
||||
@@ -46,8 +46,8 @@ func (r *RecipientResolver) ResolveNotificationRecipients(ctx context.Context, s
|
||||
|
||||
query := r.db.WithContext(ctx).Model(&model.Account{}).
|
||||
Select("id").
|
||||
Where("status = ? AND shop_id = ? AND is_primary = ? AND user_type = ?",
|
||||
constants.StatusEnabled, shopID, true, constants.UserTypeAgent)
|
||||
Where("status = ? AND shop_id = ? AND user_type = ?",
|
||||
constants.StatusEnabled, shopID, constants.UserTypeAgent)
|
||||
if target.BusinessOwnerAccountID != nil {
|
||||
query = query.Or("id = ? AND status = ? AND user_type = ?",
|
||||
*target.BusinessOwnerAccountID, constants.StatusEnabled, constants.UserTypePlatform)
|
||||
|
||||
Reference in New Issue
Block a user