Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
quxiu
Commits
ed2dfe3d
Commit
ed2dfe3d
authored
Mar 27, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
踢人
parent
d7e57e99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
37 deletions
+48
-37
api/Appapi/Model/Live.php
+13
-3
api/Appapi/Model/Livemanage.php
+35
-34
No files found.
api/Appapi/Model/Live.php
View file @
ed2dfe3d
...
...
@@ -266,7 +266,10 @@ class Model_Live extends PhalApi_Model_NotORM {
/* 直播状态 */
public
function
checkLive
(
$uid
,
$liveuid
,
$stream
){
$time
=
time
();
DI
()
->
notorm
->
live_kick
->
where
(
'uid=? and liveuid=? and addtime < ?'
,
$uid
,
$liveuid
,
$time
)
->
delete
();
/* 是否被踢出 */
$isexist
=
DI
()
->
notorm
->
live_kick
->
select
(
"id"
)
...
...
@@ -1240,15 +1243,22 @@ class Model_Live extends PhalApi_Model_NotORM {
/* 踢人 */
public
function
kicking
(
$uid
,
$liveuid
,
$touid
){
$time
=
time
();
DI
()
->
notorm
->
live_kick
->
where
(
'uid=? and liveuid=? and addtime < ?'
,
$touid
,
$liveuid
,
$time
)
->
delete
();
$isexist
=
DI
()
->
notorm
->
live_kick
->
where
(
'uid=? and liveuid=?
'
,
$touid
,
$liveuid
)
->
where
(
'uid=? and liveuid=?'
,
$touid
,
$liveuid
)
->
fetchOne
();
if
(
$isexist
){
return
1002
;
}
$rs
=
DI
()
->
notorm
->
live_kick
->
insert
([
'uid'
=>
$touid
,
'liveuid'
=>
$liveuid
,
'actionid'
=>
$uid
,
'addtime'
=>
time
()
]);
$time
+=
3600
*
12
;
$rs
=
DI
()
->
notorm
->
live_kick
->
insert
([
'uid'
=>
$touid
,
'liveuid'
=>
$liveuid
,
'actionid'
=>
$uid
,
'addtime'
=>
$time
]);
return
$rs
;
...
...
api/Appapi/Model/Livemanage.php
View file @
ed2dfe3d
...
...
@@ -3,26 +3,26 @@
class
Model_Livemanage
extends
PhalApi_Model_NotORM
{
/* 我的管理员 */
public
function
getManageList
(
$uid
)
{
$rs
=
[
'nums'
=>
'0'
,
'total'
=>
'5'
,
'list'
=>
[],
];
$nums
=
DI
()
->
notorm
->
users_livemanager
->
where
(
'liveuid=?'
,
$uid
)
->
count
();
$list
=
DI
()
->
notorm
->
users_livemanager
->
select
(
'uid'
)
->
where
(
'liveuid=?'
,
$uid
)
->
fetchAll
();
foreach
(
$list
as
$k
=>
$v
){
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
...
...
@@ -34,33 +34,33 @@ class Model_Livemanage extends PhalApi_Model_NotORM {
$rs
[
'nums'
]
=
(
string
)
$nums
;
$rs
[
'list'
]
=
$list
;
return
$rs
;
}
/* 解除管理 */
public
function
cancelManage
(
$uid
,
$touid
)
{
$rs
=
DI
()
->
notorm
->
users_livemanager
->
where
(
'liveuid=? and uid=?'
,
$uid
,
$touid
)
->
delete
();
return
$rs
;
}
/* 我的房间 */
public
function
getRoomList
(
$uid
)
{
$list
=
DI
()
->
notorm
->
users_livemanager
->
select
(
'liveuid'
)
->
where
(
'uid=?'
,
$uid
)
->
fetchAll
();
foreach
(
$list
as
$k
=>
$v
){
$userinfo
=
getUserInfo
(
$v
[
'liveuid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
...
...
@@ -70,25 +70,25 @@ class Model_Livemanage extends PhalApi_Model_NotORM {
$list
[
$k
]
=
$v
;
}
return
$list
;
}
/* 禁言用户 */
public
function
getShutList
(
$liveuid
)
{
$list
=
DI
()
->
notorm
->
live_shut
->
select
(
'uid'
)
->
where
(
'liveuid=?'
,
$liveuid
)
->
order
(
'id desc'
)
->
fetchAll
();
foreach
(
$list
as
$k
=>
$v
){
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
...
...
@@ -98,37 +98,38 @@ class Model_Livemanage extends PhalApi_Model_NotORM {
$list
[
$k
]
=
$v
;
}
return
$list
;
}
/* 解除禁言 */
public
function
cancelShut
(
$liveuid
,
$touid
)
{
$rs
=
DI
()
->
notorm
->
live_shut
->
where
(
'liveuid=? and uid=?'
,
$liveuid
,
$touid
)
->
delete
();
DI
()
->
redis
->
hDel
(
$liveuid
.
'shutup'
,
$touid
);
return
$rs
;
}
/* 踢人用户 */
public
function
getKickList
(
$liveuid
)
{
$time
=
time
();
DI
()
->
notorm
->
live_kick
->
where
(
'liveuid=? and addtime < ?'
,
$liveuid
,
$time
)
->
delete
();
$list
=
DI
()
->
notorm
->
live_kick
->
select
(
'uid'
)
->
where
(
'liveuid=?'
,
$liveuid
)
->
order
(
'id desc'
)
->
fetchAll
();
foreach
(
$list
as
$k
=>
$v
){
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
...
...
@@ -138,17 +139,17 @@ class Model_Livemanage extends PhalApi_Model_NotORM {
$list
[
$k
]
=
$v
;
}
return
$list
;
}
/* 解除踢人 */
public
function
cancelKick
(
$liveuid
,
$touid
)
{
$rs
=
DI
()
->
notorm
->
live_kick
->
where
(
'liveuid=? and uid=?'
,
$liveuid
,
$touid
)
->
delete
();
return
$rs
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment