Browse Source

Merge remote-tracking branch 'origin/master'

master
huangjiajun 3 weeks ago
parent
commit
b840e6fb41
5 changed files with 20 additions and 1 deletions
  1. +1
    -0
      src/dao/egg_energy_assistance_detail_dao.go
  2. +1
    -0
      src/dao/egg_energy_team_assistance_dao.go
  3. +9
    -0
      src/implement/egg_energy_assistance_detail_implement.go
  4. +8
    -0
      src/implement/egg_energy_team_assistance_implement.go
  5. +1
    -1
      src/model/user_egg_score_data.go

+ 1
- 0
src/dao/egg_energy_assistance_detail_dao.go View File

@@ -6,4 +6,5 @@ type EggEnergyAssistanceDetailDao interface {
//TODO:: You can add specific method definitions here
AssistanceDetailInsert(m *model.EggEnergyAssistanceDetail) (int64, error)
AssistanceDetailExist(uid, assistedUid, signId int64) (bool, error)
AssistanceDetailDeleteByDateByPage(date string, limit int) (int64, error)
}

+ 1
- 0
src/dao/egg_energy_team_assistance_dao.go View File

@@ -14,4 +14,5 @@ type EggEnergyTeamAssistanceDao interface {
EggEnergyTeamAssistanceGetOne(uid int64, date string) (*model.EggEnergyTeamAssistance, error)
EggEnergyTeamAssistanceInsert(EggEnergyTeamAssistance *model.EggEnergyTeamAssistance) (int64, error)
EggEnergyTeamAssistanceUpdate(id interface{}, EggEnergyTeamAssistance *model.EggEnergyTeamAssistance, forceColums ...string) (int64, error)
EggEnergyTeamAssistanceDeleteByDateByPage(date string, limit int) (int64, error)
}

+ 9
- 0
src/implement/egg_energy_assistance_detail_implement.go View File

@@ -3,6 +3,7 @@
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"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"
)

@@ -31,3 +32,11 @@ func (e EggEnergyAssistanceDetailDb) AssistanceDetailExist(uid, assistedUid, sig
}
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
}

+ 8
- 0
src/implement/egg_energy_team_assistance_implement.go View File

@@ -109,3 +109,11 @@ func (e EggEnergyTeamAssistanceDb) EggEnergyTeamAssistanceUpdate(id interface{},
}
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
}

+ 1
- 1
src/model/user_egg_score_data.go View File

@@ -16,7 +16,7 @@ type UserEggScoreData struct {
CollegeLearningNums int `json:"college_learning_nums" xorm:"not null default 0 comment('学院学习次数') INT(11)"`
ViolateNums int `json:"violate_nums" xorm:"not null default 0 comment('违规次数') INT(11)"`
BrowseInterfaceNums int `json:"browse_interface_nums" xorm:"not null default 0 comment('浏览界面次数') INT(11)"`
PersonAddActivityValue int `json:"person_add_activity_value" xorm:"not null default 0 comment('个人活跃积分') INT(11)"`
PersonAddActivityValue string `json:"person_add_activity_value" xorm:"not null default 0 comment('个人活跃积分') INT(11)"`
Score string `json:"score" xorm:"not null comment('分数') DECIMAL(20,8)"`
Date string `json:"date" xorm:"not null default '0000-00' comment('日期(YYYY-WW)') CHAR(50)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`


Loading…
Cancel
Save