dengbiao 4 달 전
부모
커밋
3a2975debe
6개의 변경된 파일36개의 추가작업 그리고 4개의 파일을 삭제
  1. +2
    -1
      src/super/dao/agent_list_dao.go
  2. +2
    -1
      src/super/dao/medium_list_dao.go
  3. +15
    -1
      src/super/implement/agent_list_implement.go
  4. +15
    -1
      src/super/implement/medium_list_implement.go
  5. +1
    -0
      src/super/model/agent_list.go
  6. +1
    -0
      src/super/model/medium_list.go

+ 2
- 1
src/super/dao/agent_list_dao.go 파일 보기

@@ -1,4 +1,4 @@
package dao
package dao

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

@@ -6,4 +6,5 @@ type AgentListDao interface {
GetAgentList(agentId int) (medium *model.AgentList, err error)
AgentListInsert(m *model.AgentList) (int64, error)
UpdateAgentList(m *model.AgentList, columns ...string) (int64, error)
FindAgentList(name, state string, page, limit int) (list []model.AgentList, total int64, err error)
}

+ 2
- 1
src/super/dao/medium_list_dao.go 파일 보기

@@ -1,4 +1,4 @@
package dao
package dao

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

@@ -6,4 +6,5 @@ type MediumListDao interface {
GetMediumList(mediumId int) (medium *model.MediumList, err error)
MediumListInsert(m *model.MediumList) (int64, error)
UpdateMediumList(m *model.MediumList, columns ...string) (int64, error)
FindMediumList(name, state string, page, limit int) (list []model.MediumList, total int64, err error)
}

+ 15
- 1
src/super/implement/agent_list_implement.go 파일 보기

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
@@ -42,3 +42,17 @@ func (a AgentListDb) UpdateAgentList(m *model.AgentList, columns ...string) (int
}
return affected, nil
}
func (a AgentListDb) FindAgentList(name, state string, page, limit int) (list []model.AgentList, total int64, err error) {
sess := a.Db.Where("state>0").Desc("id").Limit(limit, (page-1)*limit)
if name != "" {
sess.And("company_name like ?", "%"+name+"%")
}
if state != "" {
sess.And("state = ?", state)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 15
- 1
src/super/implement/medium_list_implement.go 파일 보기

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
@@ -42,3 +42,17 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri
}
return affected, nil
}
func (m MediumListDb) FindMediumList(name, state string, page, limit int) (list []model.MediumList, total int64, err error) {
sess := m.Db.Where("state>0").Desc("id").Limit(limit, (page-1)*limit)
if name != "" {
sess.And("company_name like ?", "%"+name+"%")
}
if state != "" {
sess.And("state = ?", state)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 1
- 0
src/super/model/agent_list.go 파일 보기

@@ -22,4 +22,5 @@ type AgentList struct {
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
}

+ 1
- 0
src/super/model/medium_list.go 파일 보기

@@ -22,4 +22,5 @@ type MediumList struct {
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
}

불러오는 중...
취소
저장