@@ -6,4 +6,5 @@ type EggEnergyAssistanceDetailDao interface { | |||||
//TODO:: You can add specific method definitions here | //TODO:: You can add specific method definitions here | ||||
AssistanceDetailInsert(m *model.EggEnergyAssistanceDetail) (int64, error) | AssistanceDetailInsert(m *model.EggEnergyAssistanceDetail) (int64, error) | ||||
AssistanceDetailExist(uid, assistedUid, signId int64) (bool, error) | AssistanceDetailExist(uid, assistedUid, signId int64) (bool, error) | ||||
AssistanceDetailDeleteByDateByPage(date string, limit int) (int64, error) | |||||
} | } |
@@ -14,4 +14,5 @@ type EggEnergyTeamAssistanceDao interface { | |||||
EggEnergyTeamAssistanceGetOne(uid int64, date string) (*model.EggEnergyTeamAssistance, error) | EggEnergyTeamAssistanceGetOne(uid int64, date string) (*model.EggEnergyTeamAssistance, error) | ||||
EggEnergyTeamAssistanceInsert(EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error) | EggEnergyTeamAssistanceInsert(EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error) | ||||
EggEnergyTeamAssistanceUpdate(id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error) | EggEnergyTeamAssistanceUpdate(id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error) | ||||
EggEnergyTeamAssistanceDeleteByDateByPage(date string, limit int) (int64, error) | |||||
} | } |
@@ -3,6 +3,7 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -31,3 +32,11 @@ func (e EggEnergyAssistanceDetailDb) AssistanceDetailExist(uid, assistedUid, sig | |||||
} | } | ||||
return exist, nil | return exist, nil | ||||
} | } | ||||
func (e EggEnergyAssistanceDetailDb) AssistanceDetailDeleteByDateByPage(date string, limit int) (int64, error) { | |||||
affected, err := e.Db.Where("created_at < ?", date).Limit(limit).Delete(&model.EggEnergyAssistanceDetail{}) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err.Error()) | |||||
} | |||||
return affected, nil | |||||
} |
@@ -109,3 +109,11 @@ func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceUpdate(id interface{}, | |||||
} | } | ||||
return affected, nil | return affected, nil | ||||
} | } | ||||
func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceDeleteByDateByPage(date string, limit int) (int64, error) { | |||||
affected, err := e.Db.Where("create_at < ?", date).Limit(limit).Delete(&model.EggEnergyTeamAssistance{}) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err.Error()) | |||||
} | |||||
return affected, nil | |||||
} |