add update sql mtime
This commit is contained in:
parent
23644f3e16
commit
53669a298f
@ -46,7 +46,7 @@ func (p *DonateSetting) InsertOrUpdate() (err error) {
|
||||
"end_date" = :end_date,
|
||||
"target_amount" = :target_amount,
|
||||
"title" = :title,
|
||||
"start_amount" = :start_amount`
|
||||
"start_amount" = :start_amount, "mtime" = now()`
|
||||
_, err = x.NamedExec(query, p)
|
||||
return
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ func (p *FacebookPage) AddPage() (err error) {
|
||||
|
||||
// UpdatePost -
|
||||
func (p *FacebookPage) UpdatePost(postID string) (err error) {
|
||||
query := `update "public"."facebook_page" set "lastpost" = $1 where id = $2`
|
||||
query := `update "public"."facebook_page" set "lastpost" = $1, "mtime" = now() where id = $2`
|
||||
_, err = x.Exec(query, postID, p.ID)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -85,7 +85,7 @@ func (p *TwitchChannel) Add() (err error) {
|
||||
|
||||
// UpdateStream -
|
||||
func (p *TwitchChannel) UpdateStream(streamID string) (err error) {
|
||||
query := `update "public"."twitch_channel" set "laststream" = $1 where "id" = $2`
|
||||
query := `update "public"."twitch_channel" set "laststream" = $1, "mtime" = now() where "id" = $2`
|
||||
_, err = x.Exec(query, streamID, p.ID)
|
||||
if err != nil {
|
||||
return
|
||||
@ -96,7 +96,7 @@ func (p *TwitchChannel) UpdateStream(streamID string) (err error) {
|
||||
|
||||
// UpdateName -
|
||||
func (p *TwitchChannel) UpdateName(name string) (err error) {
|
||||
_, err = x.Exec(`update "public"."twitch_channel" set "name" = $1 where "id" = $2`, name, p.ID)
|
||||
_, err = x.Exec(`update "public"."twitch_channel" set "name" = $1, "mtime" = now() where "id" = $2`, name, p.ID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -107,14 +107,14 @@ func (p *TwitchChannel) UpdateName(name string) (err error) {
|
||||
// UpdateJoin -
|
||||
func (p *TwitchChannel) UpdateJoin(join bool) (err error) {
|
||||
p.Join = join
|
||||
_, err = x.NamedExec(`update "public"."twitch_channel" set "join" = :join where "id" = :id`, p)
|
||||
_, err = x.NamedExec(`update "public"."twitch_channel" set "join" = :join, "mtime" = now() where "id" = :id`, p)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateOpayID -
|
||||
func (p *TwitchChannel) UpdateOpayID(id string) (err error) {
|
||||
p.OpayID = id
|
||||
_, err = x.NamedExec(`update "public"."twitch_channel" set "opayid" = :opayid where "id" = :id`, p)
|
||||
_, err = x.NamedExec(`update "public"."twitch_channel" set "opayid" = :opayid, "mtime" = now() where "id" = :id`, p)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -57,14 +57,14 @@ func (p *YoutubeChannel) Add() (err error) {
|
||||
// UpdateLastVideo -
|
||||
func (p *YoutubeChannel) UpdateLastVideo(vid string) (err error) {
|
||||
p.LastVideo = vid
|
||||
_, err = x.NamedExec(`update "public"."youtube_channel" set "lastvideo" = :lastvideo where "id" = :id`, p)
|
||||
_, err = x.NamedExec(`update "public"."youtube_channel" set "lastvideo" = :lastvideo, "mtime" = now() where "id" = :id`, p)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateExpire -
|
||||
func (p *YoutubeChannel) UpdateExpire(t int64) (err error) {
|
||||
p.Expire = t
|
||||
_, err = x.NamedExec(`update "public"."youtube_channel" set "expire" = :expire where "id" = :id`, p)
|
||||
_, err = x.NamedExec(`update "public"."youtube_channel" set "expire" = :expire, "mtime" = now() where "id" = :id`, p)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user