Esempio n. 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
}
Esempio n. 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)
}