123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package logic
- import (
- "context"
- "fmt"
- "git.i2edu.net/i2/i2-bill-erp/internal/svc"
- "git.i2edu.net/i2/i2-bill-erp/model"
- "git.i2edu.net/i2/i2-bill-erp/transform"
- "git.i2edu.net/i2/go-zero/core/logx"
- )
- type GetMkIdsLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewGetMkIdsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMkIdsLogic {
- return &GetMkIdsLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- func (l *GetMkIdsLogic) GetMkIds(in *transform.CityMkReq) (*transform.CityMkRes, error) {
- var users []model.SysUser
- err := l.svcCtx.SqlConn.QueryRowsPartial(&users, fmt.Sprintf("select id, mobile from sys_user where mobile in (%v) and del_flag!=1", in.Phones))
- if err != nil {
- return nil, err
- }
- tc := transform.CityMkRes{}
- for i := range users {
- if tc.MapList == nil {
- tc.MapList = map[string]string{}
- }
- tc.MapList[users[i].Mobile] = users[i].Id
- }
- return &tc, nil
- }
|