huangjiajun преди 1 ден
родител
ревизия
1f1fb9ecdb
променени са 2 файла, в които са добавени 14 реда и са изтрити 3 реда
  1. +2
    -1
      src/dao/egg_energy_team_assistance_dao.go
  2. +12
    -2
      src/implement/egg_energy_team_assistance_implement.go

+ 2
- 1
src/dao/egg_energy_team_assistance_dao.go Целия файл

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

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
@@ -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)
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)
EggEnergyTeamAssistanceUpdate(id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error)


+ 12
- 2
src/implement/egg_energy_team_assistance_implement.go Целия файл

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

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
@@ -64,7 +64,17 @@ func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOne(uid int64, date
}
return &m, nil
}

func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOneBySession(session *xorm.Session, uid int64, date string) (*model.EggEnergyTeamAssistance, error) {
var m model.EggEnergyTeamAssistance
has, err := session.Where("uid = ?", uid).And("date = ?", date).Get(&m)
if err != nil {
return nil, err
}
if has == false {
return nil, nil
}
return &m, nil
}
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceInsert(EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error) {
_, err := e.Db.InsertOne(EggEnergyTeamAssistance)
if err != nil {


Зареждане…
Отказ
Запис