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
2e4d5a7b
Commit
2e4d5a7b
authored
Apr 01, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
踢人
parent
a5f6eaa0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
1 deletions
+83
-1
api/Appapi/Api/User.php
+30
-1
api/Appapi/Domain/User.php
+7
-0
api/Appapi/Model/User.php
+46
-0
No files found.
api/Appapi/Api/User.php
View file @
2e4d5a7b
...
@@ -271,6 +271,12 @@ class Api_User extends PhalApi_Api {
...
@@ -271,6 +271,12 @@ class Api_User extends PhalApi_Api {
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
),
),
'familyList'
=>
array
(
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'type'
=>
array
(
'name'
=>
'type'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'类型,1今日签约,2今日直播,3全部主播'
),
),
);
);
}
}
/**
/**
...
@@ -2181,7 +2187,6 @@ class Api_User extends PhalApi_Api {
...
@@ -2181,7 +2187,6 @@ class Api_User extends PhalApi_Api {
return
$rs
;
return
$rs
;
}
}
public
function
inviteList
()
public
function
inviteList
()
{
{
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
''
,
'info'
=>
array
());
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
''
,
'info'
=>
array
());
...
@@ -2200,4 +2205,28 @@ class Api_User extends PhalApi_Api {
...
@@ -2200,4 +2205,28 @@ class Api_User extends PhalApi_Api {
$rs
[
'info'
][
0
]
=
$result
;
$rs
[
'info'
][
0
]
=
$result
;
return
$rs
;
return
$rs
;
}
}
public
function
familyList
()
{
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
''
,
'info'
=>
array
());
$uid
=
checkNull
(
$this
->
uid
);
$token
=
checkNull
(
$this
->
token
);
$checkToken
=
checkToken
(
$uid
,
$token
);
if
(
$checkToken
==
700
){
$rs
[
'code'
]
=
$checkToken
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
return
$rs
;
}
$domain
=
new
Domain_User
();
$result
=
$domain
->
familyList
(
$uid
,
$this
->
type
);
if
(
in_array
(
$result
,
[
0
,
3
]))
{
$rs
[
'code'
]
=
10001
;
$rs
[
'msg'
]
=
'无权访问!'
;
return
$rs
;
}
$rs
[
'info'
][
0
]
=
$result
;
return
$rs
;
}
}
}
api/Appapi/Domain/User.php
View file @
2e4d5a7b
...
@@ -317,4 +317,11 @@ class Domain_User {
...
@@ -317,4 +317,11 @@ class Domain_User {
$rs
=
$model
->
inviteList
(
$uid
);
$rs
=
$model
->
inviteList
(
$uid
);
return
$rs
;
return
$rs
;
}
}
public
function
familyList
(
$uid
,
$type
)
{
$model
=
new
Model_User
();
$rs
=
$model
->
familyList
(
$uid
,
$type
);
return
$rs
;
}
}
}
api/Appapi/Model/User.php
View file @
2e4d5a7b
...
@@ -1051,4 +1051,50 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -1051,4 +1051,50 @@ class Model_User extends PhalApi_Model_NotORM
return
$users
;
return
$users
;
}
}
public
function
familyList
(
$uid
,
$type
)
{
list
(
$role
,
$familyId
)
=
$this
->
getFamilyRole
(
$uid
);
if
(
in_array
(
$role
,
[
0
,
3
]))
{
return
$role
;
}
$start
=
strtotime
(
date
(
'Y-m-d 00:00:00'
));
$end
=
strtotime
(
date
(
'Y-m-d 23:59:59'
));
$where
=
"familyid=
{
$familyId
}
and state=2"
;
if
(
$type
==
1
)
{
$where
.=
" and between addtime
{
$start
}
and
{
$end
}
"
;
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
}
if
(
in_array
(
$type
,
[
2
,
3
]))
{
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
}
foreach
(
$list
as
$k
=>
$v
){
$result
=
DI
()
->
notorm
->
users_live
->
select
(
"uid"
)
->
where
(
"islive= '1' and uid=
{
$v
[
'uid'
]
}
"
)
->
fetchOne
();
if
(
$type
==
2
&&
!
$result
)
{
unset
(
$list
[
$k
]);
continue
;
}
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'sex'
]
=
$userinfo
[
'sex'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'isLive'
]
=
$result
?
1
:
0
;
$list
[
$k
]
=
$v
;
}
return
[
'list'
=>
$list
,
'count'
=>
count
(
$list
)
];
}
}
}
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