From f32e1fe47ffc4ca5b559998bf6a8924c333cb94b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 11:44:58 +0800 Subject: [PATCH] 1 --- server/imserver/model/friend.go | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/server/imserver/model/friend.go b/server/imserver/model/friend.go index e4e2c501..010a0089 100644 --- a/server/imserver/model/friend.go +++ b/server/imserver/model/friend.go @@ -35,7 +35,7 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, }, func (err error, lastInsertId int64, rowsAffected int64) { cb(err, lastInsertId, rowsAffected) - this.updateAddFriendTask(accountId1, accountId2) + this.updateAddFriendTask(accountId1, accountId2, nowTime) }, func (ds *f5.DataSet) bool { return true @@ -58,6 +58,28 @@ func (this *friend) DeleteSoft(accountId1 string, accountId2 string, cb) } -func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string) { - +func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string, nowTime int64) { + { + f5.GetJsStyleDb().Upsert( + constant.GAME_DB, + "t_friend_relationship", + [][]string{ + {"account_id1", accountId1}, + {"account_id2", accountId2}, + }, + [][]string{ + {"add_time", q5.ToString(nowTime)}, + {"deleted", "0"}, + }, + [][]string{ + {"account_id1", accountId1}, + {"account_id2", accountId2}, + {"add_time", q5.ToString(nowTime)}, + {"deleted", "0"}, + {"createtime", q5.ToString(nowTime)}, + {"modifytime", q5.ToString(nowTime)}, + }, + func (err error, lastInsertId int64, rowsAffected int64) { + }) + } }