|
|
@@ -16,7 +16,7 @@ type EggEnergyTeamAssistanceDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsInsertBySession(session *xorm.Session, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error) { |
|
|
|
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceInsertBySession(session *xorm.Session, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error) { |
|
|
|
_, err := session.InsertOne(EggEnergyTeamAssistance) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
@@ -24,7 +24,7 @@ func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsInsertBySession(s |
|
|
|
return EggEnergyTeamAssistance.Id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsUpdateBySession(session *xorm.Session, id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error) { |
|
|
|
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceUpdateBySession(session *xorm.Session, id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
@@ -40,7 +40,7 @@ func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsUpdateBySession(s |
|
|
|
return affected, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsGetOneByParamsBySession(session *xorm.Session, params map[string]interface{}) (*model.EggEnergyTeamAssistance, error) { |
|
|
|
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceGetOneByParamsBySession(session *xorm.Session, params map[string]interface{}) (*model.EggEnergyTeamAssistance, error) { |
|
|
|
var m model.EggEnergyTeamAssistance |
|
|
|
var query = fmt.Sprintf("%s =?", params["key"]) |
|
|
|
has, err := session.Where(query, params["value"]).Get(&m) |
|
|
@@ -52,3 +52,15 @@ func (e EggEnergyTeamAssistanceDb) EggStarLevelDividendsRecordsGetOneByParamsByS |
|
|
|
} |
|
|
|
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 |
|
|
|
} |