From 8bcae4b352ab34a673abe96801b60d5b513c5184 Mon Sep 17 00:00:00 2001 From: gzydong Date: Sun, 13 Dec 2020 20:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/Api/V1/UsersController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Controller/Api/V1/UsersController.php b/app/Controller/Api/V1/UsersController.php index c74c02b..888f883 100644 --- a/app/Controller/Api/V1/UsersController.php +++ b/app/Controller/Api/V1/UsersController.php @@ -2,6 +2,7 @@ namespace App\Controller\Api\V1; +use App\Cache\FriendRemarkCache; use App\Constants\SocketConstants; use Hyperf\Di\Annotation\Inject; use Hyperf\HttpServer\Annotation\Controller; @@ -233,7 +234,11 @@ class UsersController extends CController 'remarks' => "required" ]); - $isTrue = $this->friendService->editFriendRemark($this->uid(), $params['friend_id'], $params['remarks']); + $user_id = $this->uid(); + $isTrue = $this->friendService->editFriendRemark($user_id, $params['friend_id'], $params['remarks']); + if ($isTrue) { + FriendRemarkCache::set($user_id, (int)$params['friend_id'], $params['remarks']); + } return $isTrue ? $this->response->success([], '备注修改成功...')