初始化

main
gzydong 2020-12-08 23:32:23 +08:00
parent 412183584f
commit 50d6789312
4 changed files with 7 additions and 4 deletions

View File

@ -204,7 +204,7 @@ class GroupController extends CController
'group_id' => 'required|integer',
'group_name' => 'required',
'group_profile' => 'required',
'avatar' => 'required'
'avatar' => 'present|url'
]);
$result = UsersGroup::where('id', $params['group_id'])->where('user_id', $this->uid())->update([
@ -235,6 +235,10 @@ class GroupController extends CController
]);
$user_id = $this->uid();
if (in_array($user_id, $params['members_ids'])) {
return $this->response->fail('群聊用户移除失败...');
}
[$isTrue, $record_id] = $this->groupService->removeMember($params['group_id'], $user_id, $params['members_ids']);
if (!$isTrue) {
return $this->response->fail('群聊用户移除失败...');

View File

@ -50,7 +50,7 @@ class GroupService extends BaseService
$groupMember[] = [
'group_id' => $insRes->id,
'user_id' => $uid,
'group_owner' => ($k == 0) ? 1 : 0,
'group_owner' => $user_id == $uid ? 1 : 0,
'status' => 0,
'created_at' => date('Y-m-d H:i:s'),
];

View File

@ -10,7 +10,6 @@ date_default_timezone_set('Asia/Shanghai');
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
define('SWOOLE_SSL', 512);
require BASE_PATH . '/vendor/autoload.php';
// 设置服务运行ID

View File

@ -29,7 +29,7 @@ return [
'login_response' => null,
'locale' => 'en_US',
'connection_timeout' => 3.0,
'read_write_timeout' => 6.0,
'read_write_timeout' => 8.0,
'context' => null,
'keepalive' => false,
'heartbeat' => 3,