diff --git a/model/amo.go b/model/amo.go index 17dec30..5208464 100644 --- a/model/amo.go +++ b/model/amo.go @@ -207,12 +207,3 @@ const ( TypeAmoPayer FieldType = "payer" // Плательщик (только в списке Счета-покупки) TypeAmoSupplier FieldType = "supplier" // Поставщик (только в списке Счета-покупки) ) - -type CheckUserUTM struct { - ID int64 `json:"ID"` - Amofieldid int32 `json:"AmoFieldID"` - AmoFieldType EntityType `json:"Entity"` - Quizid int32 `json:"QuizID"` - Accountid int32 `json:"AccountID"` - Name string `json:"Name"` -} diff --git a/repository/amo/amo.go b/repository/amo/amo.go index 20b825f..c5f0d93 100644 --- a/repository/amo/amo.go +++ b/repository/amo/amo.go @@ -753,24 +753,20 @@ func (r *AmoRepository) GettingUserUtm(ctx context.Context, request *model.Pagin }, nil } -func (r *AmoRepository) GetUserUTMByListIDs(ctx context.Context, ids []int32) ([]model.CheckUserUTM, error) { - rows, err := r.queries.GetUserUTMByListIDs(ctx, ids) +func (r *AmoRepository) CheckUserUtms(ctx context.Context, ids []int32) ([]model.UTM, error) { + rows, err := r.queries.CheckUtms(ctx, ids) if err != nil { return nil, err } - var utmS []model.CheckUserUTM + var utmS []model.UTM for _, row := range rows { - var entity model.EntityType - v := string(row.Amofieldtype.([]byte)) - entity = model.EntityType(v) - utm := model.CheckUserUTM{ - ID: row.ID, - Amofieldid: row.Amofieldid, - Quizid: row.Quizid, - Accountid: row.Accountid, - Name: row.Name, - AmoFieldType: entity, + utm := model.UTM{ + ID: row.ID, + Amofieldid: row.Amofieldid, + Quizid: row.Quizid, + Accountid: row.Accountid, + Name: row.Name, } utmS = append(utmS, utm)