优化代码
parent
c67f9877d4
commit
8d8c4d90e9
|
@ -44,9 +44,8 @@ class ContactsApplyController extends CController
|
||||||
$params['friend_id'] = (int)$params['friend_id'];
|
$params['friend_id'] = (int)$params['friend_id'];
|
||||||
|
|
||||||
$user = $userService->findById($params['friend_id']);
|
$user = $userService->findById($params['friend_id']);
|
||||||
if (!$user) {
|
|
||||||
return $this->response->fail('用户不存在!');
|
if (!$user) return $this->response->fail('用户不存在!');
|
||||||
}
|
|
||||||
|
|
||||||
$user_id = $this->uid();
|
$user_id = $this->uid();
|
||||||
$key = "{$user_id}_{$params['friend_id']}";
|
$key = "{$user_id}_{$params['friend_id']}";
|
||||||
|
|
|
@ -24,7 +24,6 @@ use Swoole\Websocket\Frame;
|
||||||
use Swoole\Http\Response;
|
use Swoole\Http\Response;
|
||||||
use Swoole\WebSocket\Server;
|
use Swoole\WebSocket\Server;
|
||||||
use App\Service\SocketClientService;
|
use App\Service\SocketClientService;
|
||||||
use App\Model\Group\GroupMember;
|
|
||||||
use App\Event\TalkEvent;
|
use App\Event\TalkEvent;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue