dengbiao 3 月之前
父節點
當前提交
2345c97fc9
共有 2 個檔案被更改,包括 9 行新增0 行删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存