补充一些通知
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m7s

This commit is contained in:
2026-07-28 15:50:12 +08:00
parent 9303af3d46
commit 1fee19feeb
12 changed files with 151 additions and 27 deletions

View File

@@ -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)