|
@@ -56,11 +56,11 @@ func FindSubAccountByPhone(ctx context.Context, phone string) (*gorm_model.Young
|
|
|
}
|
|
|
|
|
|
// FindSubAccountByEnterpriseId 根据商家ID查找包含的所有子账号信息
|
|
|
-func FindSubAccountByEnterpriseId(ctx context.Context, enterpriseId string) ([]*gorm_model.YounggeeSubAccount, int64, error) {
|
|
|
+func FindSubAccountByEnterpriseId(ctx context.Context, enterpriseId string, jobId int, accountStatus int) ([]*gorm_model.YounggeeSubAccount, int64, error) {
|
|
|
db := GetReadDB(ctx)
|
|
|
var total int64
|
|
|
var subAccount []*gorm_model.YounggeeSubAccount
|
|
|
- whereCondition := gorm_model.YounggeeSubAccount{EnterpriseId: enterpriseId, SubAccountType: 1}
|
|
|
+ whereCondition := gorm_model.YounggeeSubAccount{EnterpriseId: enterpriseId, SubAccountType: 1, JobId: jobId, AccountStatus: accountStatus}
|
|
|
err := db.Model(gorm_model.YounggeeSubAccount{}).Where(whereCondition).Find(&subAccount).Count(&total).Error
|
|
|
if err != nil {
|
|
|
return nil, 0, err
|