mirror of
https://github.com/PretendoNetwork/friends.git
synced 2025-04-02 11:01:46 -04:00
22 lines
500 B
Go
22 lines
500 B
Go
package database_wiiu
|
|
|
|
import (
|
|
"github.com/PretendoNetwork/friends/database"
|
|
"github.com/PretendoNetwork/nex-go/v2/types"
|
|
)
|
|
|
|
// UpdateUserLastOnlineTime updates a user's last online time
|
|
func UpdateUserLastOnlineTime(pid uint32, lastOnline types.DateTime) error {
|
|
_, err := database.Manager.Exec(`
|
|
INSERT INTO wiiu.user_data (pid, last_online)
|
|
VALUES ($1, $2)
|
|
ON CONFLICT (pid)
|
|
DO UPDATE SET
|
|
last_online = $2`, pid, uint64(lastOnline))
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|