1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-14 16:26:23 -07:00

Move internal report creation code to gcsql

Also insert the report's timestamp into the report audit table
This commit is contained in:
Eggbertx 2022-07-26 11:31:13 -07:00
parent 90ba350777
commit c64d7b16e8
4 changed files with 75 additions and 15 deletions

View file

@ -335,6 +335,16 @@ type Report struct {
IsCleared bool
}
func (r *Report) Timestamp() (*time.Time, error) {
sql := `SELECT timestamp FROM DBPREFIXreports_audit WHERE report_id = ?`
timestamp := new(time.Time)
err := QueryRowSQL(sql, interfaceSlice(r.ID), interfaceSlice(timestamp))
if err != nil {
return nil, err
}
return timestamp, nil
}
type LoginSession struct {
ID uint
Name string
@ -373,7 +383,7 @@ func (s *Staff) RankString() string {
case 1:
return "Janitor"
}
return ""
return "Unknown"
}
type BoardCooldowns struct {