admin: can sort claim by last_update
This commit is contained in:
parent
83b7df7e69
commit
d8584a8a31
4 changed files with 31 additions and 2 deletions
|
|
@ -193,6 +193,12 @@ type ClaimDescription struct {
|
|||
Publish bool `json:"publish"`
|
||||
}
|
||||
|
||||
// GetLastUpdate returns the date of the latest message written for the given Claim.
|
||||
func (c Claim) GetLastUpdate() (res *time.Time, err error) {
|
||||
err = DBQueryRow("SELECT MAX(date) FROM claim_descriptions WHERE id_claim = ? GROUP BY id_claim", c.Id).Scan(&res)
|
||||
return
|
||||
}
|
||||
|
||||
// GetDescriptions returns a list of all descriptions stored in the database for the Claim.
|
||||
func (c Claim) GetDescriptions() (res []ClaimDescription, err error) {
|
||||
var rows *sql.Rows
|
||||
|
|
|
|||
Reference in a new issue