dengbiao 3 months ago
parent
commit
2345c97fc9
2 changed files with 9 additions and 0 deletions
  1. +1
    -0
      src/super/dao/agent_with_medium_dao.go
  2. +8
    -0
      src/super/implement/agent_with_medium_db.go

+ 1
- 0
src/super/dao/agent_with_medium_dao.go View File

@@ -3,6 +3,7 @@ package dao
import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type AgentWithMediumDao interface {
AgentWithMediumInsert(m *model.AgentWithMedium) (int64, error)
FindAgentWithMediumList(name, state string, agentId, mediumId, page, limit int) (list []AgentWithMediumGroup, total int64, err error)
GetAgentWithMediumByMediumIdAndAgentId(mediumId, agentId int) (medium *model.AgentWithMedium)
FindAgentWithMediumListByMediumIdAll(mediumId int) (list []model.AgentWithMedium, err error)


+ 8
- 0
src/super/implement/agent_with_medium_db.go View File

@@ -14,6 +14,14 @@ type AgentWithMediumDb struct {
Db *xorm.Engine
}

func (a AgentWithMediumDb) AgentWithMediumInsert(m *model.AgentWithMedium) (int64, error) {
insertAffected, err := a.Db.InsertOne(m)
if err != nil {
return 0, err
}
return insertAffected, nil
}

func (a AgentWithMediumDb) GetAgentWithMediumByMediumIdAndAgentId(mediumId, agentId int) (medium *model.AgentWithMedium) {
medium = new(model.AgentWithMedium)
get, err := a.Db.Where("medium_id=? and agent_id=?", mediumId, agentId).Get(medium)


Loading…
Cancel
Save