初始化
parent
412183584f
commit
50d6789312
|
@ -204,7 +204,7 @@ class GroupController extends CController
|
||||||
'group_id' => 'required|integer',
|
'group_id' => 'required|integer',
|
||||||
'group_name' => 'required',
|
'group_name' => 'required',
|
||||||
'group_profile' => 'required',
|
'group_profile' => 'required',
|
||||||
'avatar' => 'required'
|
'avatar' => 'present|url'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$result = UsersGroup::where('id', $params['group_id'])->where('user_id', $this->uid())->update([
|
$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();
|
$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']);
|
[$isTrue, $record_id] = $this->groupService->removeMember($params['group_id'], $user_id, $params['members_ids']);
|
||||||
if (!$isTrue) {
|
if (!$isTrue) {
|
||||||
return $this->response->fail('群聊用户移除失败...');
|
return $this->response->fail('群聊用户移除失败...');
|
||||||
|
|
|
@ -50,7 +50,7 @@ class GroupService extends BaseService
|
||||||
$groupMember[] = [
|
$groupMember[] = [
|
||||||
'group_id' => $insRes->id,
|
'group_id' => $insRes->id,
|
||||||
'user_id' => $uid,
|
'user_id' => $uid,
|
||||||
'group_owner' => ($k == 0) ? 1 : 0,
|
'group_owner' => $user_id == $uid ? 1 : 0,
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
'created_at' => date('Y-m-d H:i:s'),
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
];
|
];
|
||||||
|
|
|
@ -10,7 +10,6 @@ date_default_timezone_set('Asia/Shanghai');
|
||||||
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
||||||
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
||||||
|
|
||||||
define('SWOOLE_SSL', 512);
|
|
||||||
require BASE_PATH . '/vendor/autoload.php';
|
require BASE_PATH . '/vendor/autoload.php';
|
||||||
|
|
||||||
// 设置服务运行ID
|
// 设置服务运行ID
|
||||||
|
|
|
@ -29,7 +29,7 @@ return [
|
||||||
'login_response' => null,
|
'login_response' => null,
|
||||||
'locale' => 'en_US',
|
'locale' => 'en_US',
|
||||||
'connection_timeout' => 3.0,
|
'connection_timeout' => 3.0,
|
||||||
'read_write_timeout' => 6.0,
|
'read_write_timeout' => 8.0,
|
||||||
'context' => null,
|
'context' => null,
|
||||||
'keepalive' => false,
|
'keepalive' => false,
|
||||||
'heartbeat' => 3,
|
'heartbeat' => 3,
|
||||||
|
|
Loading…
Reference in New Issue