Example #1
0
// Insert
func InsertReport(userId int, startDay string, report models.Report) error {

	report.UserId = userId
	report.StartDay = startDay
	report.Status = constant.STATUS_ARI
	return DB.Debug().Create(&report).Error
}
Example #2
0
// Update
func UpdateReport(id, userId int, startDay string, report models.Report) {

	report.Id = id
	report.UserId = userId
	report.StartDay = startDay
	report.Status = constant.STATUS_ARI

	DB.Debug().Where("Status = ?", constant.STATUS_ARI).Save(&report)
}
Example #3
0
// 前週の進捗データを今週の進捗に設定
func (c PJ) setLastReport(lastReport *models.Report) *models.Report {
	report := models.Report{}
	report.Kotei = lastReport.Kotei
	report.Hokoku = lastReport.Hokoku
	report.Kadai = lastReport.Kadai
	report.Other = lastReport.Other
	report.Sagyo8 = lastReport.Sagyo1
	report.Sagyo9 = lastReport.Sagyo2
	report.Sagyo10 = lastReport.Sagyo3
	report.Sagyo11 = lastReport.Sagyo4
	report.Sagyo12 = lastReport.Sagyo5
	report.Sagyo13 = lastReport.Sagyo6
	report.Sagyo14 = lastReport.Sagyo7
	report.Kadotime8 = lastReport.Kadotime1
	report.Kadotime9 = lastReport.Kadotime2
	report.Kadotime10 = lastReport.Kadotime3
	report.Kadotime11 = lastReport.Kadotime4
	report.Kadotime12 = lastReport.Kadotime5
	report.Kadotime13 = lastReport.Kadotime6
	report.Kadotime14 = lastReport.Kadotime7

	return &report
}