huangjiajun пре 3 месеци
родитељ
комит
a58ca385e5
4 измењених фајлова са 25 додато и 0 уклоњено
  1. +1
    -0
      src/super/dao/agent_settlement_dao.go
  2. +1
    -0
      src/super/dao/agent_with_medium_dao.go
  3. +12
    -0
      src/super/implement/agent_settlement_implement.go
  4. +11
    -0
      src/super/implement/agent_with_medium_db.go

+ 1
- 0
src/super/dao/agent_settlement_dao.go Прегледај датотеку

@@ -10,4 +10,5 @@ type AgentSettlementDao interface {
AgentSettlementInsertBySession(session *xorm.Session, m *model.AgentSettlement) (int64, error)
UpdateAgentSettlementBySession(session *xorm.Session, agentSettlement *model.AgentSettlement, columns ...string) (int64, error)
FindAgentSettlementList(uuid, mediumId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.AgentSettlement, total int64, err error)
GetAgentSettlementById(id int) (mediumSettlement *model.AgentSettlement, err error)
}

+ 1
- 0
src/super/dao/agent_with_medium_dao.go Прегледај датотеку

@@ -6,6 +6,7 @@ type AgentWithMediumDao interface {
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)
FindAgentWithMediumListByAgentIdAll(agentId int) (list []model.AgentWithMedium, err error)
}
type AgentWithMediumGroup struct {
model.AgentWithMedium `xorm:"extends"`


+ 12
- 0
src/super/implement/agent_settlement_implement.go Прегледај датотеку

@@ -43,6 +43,18 @@ func (a AgentSettlementDb) AgentSettlementInsertBySession(session *xorm.Session,
}
return insertAffected, nil
}

func (a AgentSettlementDb) GetAgentSettlementById(id int) (mediumSettlement *model.AgentSettlement, err error) {
mediumSettlement = new(model.AgentSettlement)
has, err := a.Db.Where("id =?", id).Get(mediumSettlement)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return mediumSettlement, nil
}
func (a AgentSettlementDb) FindAgentSettlementList(uuid, agentId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.AgentSettlement, total int64, err error) {
sess := a.Db.OrderBy("start_date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {


+ 11
- 0
src/super/implement/agent_with_medium_db.go Прегледај датотеку

@@ -55,3 +55,14 @@ func (a AgentWithMediumDb) FindAgentWithMediumListByMediumIdAll(mediumId int) (l
}
return
}
func (a AgentWithMediumDb) FindAgentWithMediumListByAgentIdAll(agentId int) (list []model.AgentWithMedium, err error) {
sess := a.Db.Desc("id")
if agentId > 0 {
sess.And("agent_id = ?", agentId)
}
err = sess.Find(&list)
if err != nil {
return nil, err
}
return
}

Loading…
Откажи
Сачувај