huangjiajun před 1 dnem
rodič
revize
096d2e783f
2 změnil soubory, kde provedl 13 přidání a 1 odebrání
  1. +1
    -0
      src/dao/egg_energy_team_assistance_dao.go
  2. +12
    -1
      src/implement/egg_energy_team_assistance_implement.go

+ 1
- 0
src/dao/egg_energy_team_assistance_dao.go Zobrazit soubor

@@ -9,6 +9,7 @@ type EggEnergyTeamAssistanceDao interface {
EggEnergyTeamAssistanceInsertBySession(session *xorm.Session, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error)
EggEnergyTeamAssistanceUpdateBySession(session *xorm.Session, id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error)
EggEnergyTeamAssistanceGetOneByParamsBySession(session *xorm.Session, params map[string]interface{}) (*model.EggEnergyTeamAssistance, error)
EggEnergyTeamAssistanceGetOneByParams(params map[string]interface{}) (*model.EggEnergyTeamAssistance, error)
EggEnergyTeamAssistanceGetOneBySession(session *xorm.Session, uid int64, date string) (*model.EggEnergyTeamAssistance, error)
EggEnergyTeamAssistanceGetOne(uid int64, date string) (*model.EggEnergyTeamAssistance, error)
EggEnergyTeamAssistanceInsert(EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error)


+ 12
- 1
src/implement/egg_energy_team_assistance_implement.go Zobrazit soubor

@@ -52,7 +52,18 @@ func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOneByParamsBySessio
}
return &m, nil
}

func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOneByParams(params map[string]interface{}) (*model.EggEnergyTeamAssistance, error) {
var m model.EggEnergyTeamAssistance
var query = fmt.Sprintf("%s =?", params["key"])
has, err := e.Db.Where(query, params["value"]).Get(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return &m, nil
}
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOne(uid int64, date string) (*model.EggEnergyTeamAssistance, error) {
var m model.EggEnergyTeamAssistance
has, err := e.Db.Where("uid = ?", uid).And("date = ?", date).Get(&m)


Načítá se…
Zrušit
Uložit