Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
haishi
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
冷斌
haishi
Commits
2b2a3923
Commit
2b2a3923
authored
Apr 16, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
5d1f273a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
111 deletions
+113
-111
application/User/Controller/IndexadminController.class.php
+113
-111
No files found.
application/User/Controller/IndexadminController.class.php
View file @
2b2a3923
...
@@ -6,58 +6,58 @@
...
@@ -6,58 +6,58 @@
namespace
User\Controller
;
namespace
User\Controller
;
use
Common\Controller\AdminbaseController
;
use
Common\Controller\AdminbaseController
;
class
IndexadminController
extends
AdminbaseController
{
class
IndexadminController
extends
AdminbaseController
{
protected
$users_model
;
protected
$users_model
;
function
_initialize
()
{
function
_initialize
()
{
parent
::
_initialize
();
parent
::
_initialize
();
$this
->
users_model
=
D
(
"Common/Users"
);
$this
->
users_model
=
D
(
"Common/Users"
);
}
}
function
index
(){
function
index
(){
$map
=
array
();
$map
=
array
();
$map
[
'user_type'
]
=
2
;
$map
[
'user_type'
]
=
2
;
if
(
$_REQUEST
[
'iszombie'
]
!=
''
){
if
(
$_REQUEST
[
'iszombie'
]
!=
''
){
$map
[
'iszombie'
]
=
$_REQUEST
[
'iszombie'
];
$map
[
'iszombie'
]
=
$_REQUEST
[
'iszombie'
];
$_GET
[
'iszombie'
]
=
$_REQUEST
[
'iszombie'
];
$_GET
[
'iszombie'
]
=
$_REQUEST
[
'iszombie'
];
}
}
if
(
$_REQUEST
[
'isban'
]
!=
''
){
if
(
$_REQUEST
[
'isban'
]
!=
''
){
$map
[
'user_status'
]
=
$_REQUEST
[
'isban'
];
$map
[
'user_status'
]
=
$_REQUEST
[
'isban'
];
$_GET
[
'isban'
]
=
$_REQUEST
[
'isban'
];
$_GET
[
'isban'
]
=
$_REQUEST
[
'isban'
];
}
}
if
(
$_REQUEST
[
'issuper'
]
!=
''
){
if
(
$_REQUEST
[
'issuper'
]
!=
''
){
$map
[
'issuper'
]
=
$_REQUEST
[
'issuper'
];
$map
[
'issuper'
]
=
$_REQUEST
[
'issuper'
];
$_GET
[
'issuper'
]
=
$_REQUEST
[
'issuper'
];
$_GET
[
'issuper'
]
=
$_REQUEST
[
'issuper'
];
}
}
if
(
$_REQUEST
[
'source'
]
!=
''
){
if
(
$_REQUEST
[
'source'
]
!=
''
){
$map
[
'source'
]
=
$_REQUEST
[
'source'
];
$map
[
'source'
]
=
$_REQUEST
[
'source'
];
$_GET
[
'source'
]
=
$_REQUEST
[
'source'
];
$_GET
[
'source'
]
=
$_REQUEST
[
'source'
];
}
}
if
(
$_REQUEST
[
'ishot'
]
!=
''
){
if
(
$_REQUEST
[
'ishot'
]
!=
''
){
$map
[
'ishot'
]
=
$_REQUEST
[
'ishot'
];
$map
[
'ishot'
]
=
$_REQUEST
[
'ishot'
];
$_GET
[
'ishot'
]
=
$_REQUEST
[
'ishot'
];
$_GET
[
'ishot'
]
=
$_REQUEST
[
'ishot'
];
}
}
if
(
$_REQUEST
[
'iszombiep'
]
!=
''
){
if
(
$_REQUEST
[
'iszombiep'
]
!=
''
){
$map
[
'iszombiep'
]
=
$_REQUEST
[
'iszombiep'
];
$map
[
'iszombiep'
]
=
$_REQUEST
[
'iszombiep'
];
$_GET
[
'iszombiep'
]
=
$_REQUEST
[
'iszombiep'
];
$_GET
[
'iszombiep'
]
=
$_REQUEST
[
'iszombiep'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'create_time'
]
=
array
(
"gt"
,
$_REQUEST
[
'start_time'
]);
$map
[
'create_time'
]
=
array
(
"gt"
,
$_REQUEST
[
'start_time'
]);
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'create_time'
]
=
array
(
"lt"
,
$_REQUEST
[
'end_time'
]);
$map
[
'create_time'
]
=
array
(
"lt"
,
$_REQUEST
[
'end_time'
]);
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
...
@@ -73,10 +73,10 @@ class IndexadminController extends AdminbaseController {
...
@@ -73,10 +73,10 @@ class IndexadminController extends AdminbaseController {
$where
[
'id|user_login|user_nicename'
]
=
array
(
"like"
,
"%"
.
$keyword
.
"%"
);
$where
[
'id|user_login|user_nicename'
]
=
array
(
"like"
,
"%"
.
$keyword
.
"%"
);
$where
[
'_logic'
]
=
"or"
;
$where
[
'_logic'
]
=
"or"
;
$map
[
'_complex'
]
=
$where
;
$map
[
'_complex'
]
=
$where
;
$_GET
[
'keyword'
]
=
$keyword
;
$_GET
[
'keyword'
]
=
$keyword
;
}
}
$Agent_code
=
M
(
'users_agent_code'
);
$Agent_code
=
M
(
'users_agent_code'
);
$users_model
=
$this
->
users_model
;
$users_model
=
$this
->
users_model
;
...
@@ -89,14 +89,16 @@ class IndexadminController extends AdminbaseController {
...
@@ -89,14 +89,16 @@ class IndexadminController extends AdminbaseController {
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$v
[
'code'
]
=
$Agent_code
->
where
(
"uid =
{
$v
[
'id'
]
}
"
)
->
getField
(
'code'
);
$v
[
'code'
]
=
$Agent_code
->
where
(
"uid =
{
$v
[
'id'
]
}
"
)
->
getField
(
'code'
);
var_dump
(
$v
);
die
;
$lists
[
$k
]
=
$v
;
$lists
[
$k
]
=
$v
;
}
}
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'count'
,
$count
);
$this
->
assign
(
'count'
,
$count
);
$this
->
assign
(
"page"
,
$page
->
show
(
"Admin"
));
$this
->
assign
(
"page"
,
$page
->
show
(
"Admin"
));
$this
->
display
(
":index"
);
$this
->
display
(
":index"
);
}
}
function
del
(){
function
del
(){
...
@@ -131,18 +133,18 @@ class IndexadminController extends AdminbaseController {
...
@@ -131,18 +133,18 @@ class IndexadminController extends AdminbaseController {
M
(
"users_car"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
M
(
"users_car"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
/* 删除家族关系 */
/* 删除家族关系 */
M
(
"users_family"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
M
(
"users_family"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
/* 删除推送PUSHID */
/* 删除推送PUSHID */
M
(
"users_pushid"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
M
(
"users_pushid"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
/* 删除钱包账号 */
/* 删除钱包账号 */
M
(
"users_cash_account"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
M
(
"users_cash_account"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
/* 删除游戏下注记录 */
/* 删除游戏下注记录 */
M
(
"users_gamerecord"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
M
(
"users_gamerecord"
)
->
where
(
"uid='
{
$id
}
'"
)
->
delete
();
/* 删除自己的标签 */
/* 删除自己的标签 */
M
(
"users_label"
)
->
where
(
"touid='
{
$id
}
'"
)
->
delete
();
M
(
"users_label"
)
->
where
(
"touid='
{
$id
}
'"
)
->
delete
();
/* 家族长处理 */
/* 家族长处理 */
$isexist
=
M
(
"family"
)
->
field
(
"id"
)
->
where
(
"uid=
{
$id
}
"
)
->
find
();
$isexist
=
M
(
"family"
)
->
field
(
"id"
)
->
where
(
"uid=
{
$id
}
"
)
->
find
();
if
(
$isexist
){
if
(
$isexist
){
...
@@ -151,9 +153,9 @@ class IndexadminController extends AdminbaseController {
...
@@ -151,9 +153,9 @@ class IndexadminController extends AdminbaseController {
'signout'
=>
2
,
'signout'
=>
2
,
'signout_istip'
=>
2
,
'signout_istip'
=>
2
,
);
);
M
(
"users_family"
)
->
where
(
"familyid=
{
$isexist
[
'id'
]
}
"
)
->
save
(
$data
);
M
(
"users_family"
)
->
where
(
"familyid=
{
$isexist
[
'id'
]
}
"
)
->
save
(
$data
);
M
(
"family_profit"
)
->
where
(
"familyid=
{
$isexist
[
'id'
]
}
"
)
->
delete
();
M
(
"family_profit"
)
->
where
(
"familyid=
{
$isexist
[
'id'
]
}
"
)
->
delete
();
M
(
"family_profit"
)
->
where
(
"id=
{
$isexist
[
'id'
]
}
"
)
->
delete
();
M
(
"family_profit"
)
->
where
(
"id=
{
$isexist
[
'id'
]
}
"
)
->
delete
();
}
}
/* 清除redis缓存 */
/* 清除redis缓存 */
delcache
(
"userinfo_"
.
$id
,
"token_"
.
$id
);
delcache
(
"userinfo_"
.
$id
,
"token_"
.
$id
);
...
@@ -164,7 +166,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -164,7 +166,7 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
ban
(){
function
ban
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -179,7 +181,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -179,7 +181,7 @@ class IndexadminController extends AdminbaseController {
foreach
(
$live
as
$k
=>
$v
){
foreach
(
$live
as
$k
=>
$v
){
$redis
->
hSet
(
$v
[
'uid'
]
.
'shutup'
,
$id
,
$time
);
$redis
->
hSet
(
$v
[
'uid'
]
.
'shutup'
,
$id
,
$time
);
}
}
$redis
->
close
();
$redis
->
close
();
$this
->
success
(
"会员拉黑成功!"
);
$this
->
success
(
"会员拉黑成功!"
);
}
else
{
}
else
{
$this
->
error
(
'会员拉黑失败!'
);
$this
->
error
(
'会员拉黑失败!'
);
...
@@ -188,8 +190,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -188,8 +190,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
cancelban
(){
function
cancelban
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'user_status'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'user_status'
,
'1'
);
...
@@ -211,7 +213,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -211,7 +213,7 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
cancelsuper
(){
function
cancelsuper
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
...
@@ -232,8 +234,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -232,8 +234,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
super
(){
function
super
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'issuper'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'issuper'
,
'1'
);
...
@@ -269,7 +271,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -269,7 +271,7 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
hot
(){
function
hot
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -285,8 +287,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -285,8 +287,8 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
cancelrecommend
(){
function
cancelrecommend
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -303,8 +305,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -303,8 +305,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
recommend
(){
function
recommend
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'isrecommend'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'isrecommend'
,
'1'
);
...
@@ -320,7 +322,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -320,7 +322,7 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
cancelzombie
(){
function
cancelzombie
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -336,8 +338,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -336,8 +338,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
zombie
(){
function
zombie
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'iszombie'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'iszombie'
,
'1'
);
...
@@ -351,8 +353,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -351,8 +353,8 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
zombieall
(){
function
zombieall
(){
$iszombie
=
intval
(
$_GET
[
'iszombie'
]);
$iszombie
=
intval
(
$_GET
[
'iszombie'
]);
$rst
=
M
(
"Users"
)
->
where
(
"user_type='2'"
)
->
setField
(
'iszombie'
,
$iszombie
);
$rst
=
M
(
"Users"
)
->
where
(
"user_type='2'"
)
->
setField
(
'iszombie'
,
$iszombie
);
...
@@ -362,15 +364,15 @@ class IndexadminController extends AdminbaseController {
...
@@ -362,15 +364,15 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$action
=
"关闭全部会员僵尸粉"
;
$action
=
"关闭全部会员僵尸粉"
;
}
}
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
"操作成功!"
);
$this
->
success
(
"操作成功!"
);
}
else
{
}
else
{
$this
->
error
(
'操作失败!'
);
$this
->
error
(
'操作失败!'
);
}
}
}
}
function
cancelzombiep
(){
function
cancelzombiep
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -387,8 +389,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -387,8 +389,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
zombiep
(){
function
zombiep
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'iszombiep'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'iszombiep'
,
'1'
);
...
@@ -398,7 +400,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -398,7 +400,7 @@ class IndexadminController extends AdminbaseController {
$users_zombie
=
M
(
"users_zombie"
);
$users_zombie
=
M
(
"users_zombie"
);
$isexist
=
$users_zombie
->
where
(
"uid=
{
$id
}
"
)
->
find
();
$isexist
=
$users_zombie
->
where
(
"uid=
{
$id
}
"
)
->
find
();
if
(
!
$isexist
){
if
(
!
$isexist
){
$users_zombie
->
add
(
array
(
"uid"
=>
$id
));
$users_zombie
->
add
(
array
(
"uid"
=>
$id
));
}
}
$this
->
success
(
"开启成功!"
);
$this
->
success
(
"开启成功!"
);
}
else
{
}
else
{
...
@@ -407,8 +409,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -407,8 +409,8 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
//批量设置僵尸粉
//批量设置僵尸粉
public
function
zombiepbatch
()
{
public
function
zombiepbatch
()
{
$iszombiep
=
intval
(
$_GET
[
'iszombiep'
]);
$iszombiep
=
intval
(
$_GET
[
'iszombiep'
]);
...
@@ -421,9 +423,9 @@ class IndexadminController extends AdminbaseController {
...
@@ -421,9 +423,9 @@ class IndexadminController extends AdminbaseController {
foreach
(
$ids
as
$k
=>
$v
){
foreach
(
$ids
as
$k
=>
$v
){
$isexist
=
$users_zombie
->
where
(
"uid=
{
$v
}
"
)
->
find
();
$isexist
=
$users_zombie
->
where
(
"uid=
{
$v
}
"
)
->
find
();
if
(
!
$isexist
){
if
(
!
$isexist
){
$users_zombie
->
add
(
array
(
"uid"
=>
$v
));
$users_zombie
->
add
(
array
(
"uid"
=>
$v
));
}
}
}
}
$action
=
"开启会员僵尸粉:
{
$tids
}
"
;
$action
=
"开启会员僵尸粉:
{
$tids
}
"
;
}
else
{
}
else
{
...
@@ -435,8 +437,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -435,8 +437,8 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'设置失败!'
);
$this
->
error
(
'设置失败!'
);
}
}
}
}
function
cancelrecord
(){
function
cancelrecord
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
...
@@ -452,8 +454,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -452,8 +454,8 @@ class IndexadminController extends AdminbaseController {
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
record
(){
function
record
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
)
{
if
(
$id
)
{
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'isrecord'
,
'1'
);
$rst
=
M
(
"Users"
)
->
where
(
array
(
"id"
=>
$id
,
"user_type"
=>
2
))
->
setField
(
'isrecord'
,
'1'
);
...
@@ -467,8 +469,8 @@ class IndexadminController extends AdminbaseController {
...
@@ -467,8 +469,8 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
recordall
(){
function
recordall
(){
$isrecord
=
intval
(
$_GET
[
'isrecord'
]);
$isrecord
=
intval
(
$_GET
[
'isrecord'
]);
$rst
=
M
(
"Users"
)
->
where
(
"user_type='2'"
)
->
setField
(
'isrecord'
,
$isrecord
);
$rst
=
M
(
"Users"
)
->
where
(
"user_type='2'"
)
->
setField
(
'isrecord'
,
$isrecord
);
...
@@ -478,20 +480,20 @@ class IndexadminController extends AdminbaseController {
...
@@ -478,20 +480,20 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$action
=
"关闭全部会员回放:"
;
$action
=
"关闭全部会员回放:"
;
}
}
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
"操作成功!"
);
$this
->
success
(
"操作成功!"
);
}
else
{
}
else
{
$this
->
error
(
'操作失败!'
);
$this
->
error
(
'操作失败!'
);
}
}
}
}
function
add
(){
function
add
(){
$this
->
display
(
":add"
);
$this
->
display
(
":add"
);
}
}
function
add_post
(){
function
add_post
(){
if
(
IS_POST
){
if
(
IS_POST
){
$user
=
$this
->
users_model
;
$user
=
$this
->
users_model
;
$user_login
=
I
(
'user_login'
);
$user_login
=
I
(
'user_login'
);
if
(
$user_login
==
''
){
if
(
$user_login
==
''
){
...
@@ -505,18 +507,18 @@ class IndexadminController extends AdminbaseController {
...
@@ -505,18 +507,18 @@ class IndexadminController extends AdminbaseController {
$user
->
user_type
=
2
;
$user
->
user_type
=
2
;
$user
->
user_pass
=
sp_password
(
$_POST
[
'user_pass'
]);
$user
->
user_pass
=
sp_password
(
$_POST
[
'user_pass'
]);
$avatar
=
$_POST
[
'avatar'
];
$avatar
=
$_POST
[
'avatar'
];
if
(
$avatar
==
''
){
if
(
$avatar
==
''
){
$user
->
avatar
=
'/default.jpg'
;
$user
->
avatar
=
'/default.jpg'
;
$user
->
avatar_thumb
=
'/default_thumb.jpg'
;
$user
->
avatar_thumb
=
'/default_thumb.jpg'
;
}
else
if
(
strpos
(
$avatar
,
'http'
)
===
0
){
}
else
if
(
strpos
(
$avatar
,
'http'
)
===
0
){
/* 绝对路径 */
/* 绝对路径 */
$user
->
avatar
=
$avatar
;
$user
->
avatar
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
}
else
if
(
strpos
(
$avatar
,
'/'
)
===
0
){
}
else
if
(
strpos
(
$avatar
,
'/'
)
===
0
){
/* 本地图片 */
/* 本地图片 */
$user
->
avatar
=
$avatar
;
$user
->
avatar
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
}
else
{
}
else
{
/* 七牛 */
/* 七牛 */
//$user->avatar= $avatar.'?imageView2/2/w/600/h/600'; //600 X 600
//$user->avatar= $avatar.'?imageView2/2/w/600/h/600'; //600 X 600
...
@@ -534,57 +536,57 @@ class IndexadminController extends AdminbaseController {
...
@@ -534,57 +536,57 @@ class IndexadminController extends AdminbaseController {
->
where
(
"uid =
{
$result
}
"
)
->
where
(
"uid =
{
$result
}
"
)
->
find
();
->
find
();
if
(
$isexist
){
if
(
$isexist
){
$Agent_code
->
where
(
"uid =
{
$result
}
"
)
->
save
(
$code_info
);
$Agent_code
->
where
(
"uid =
{
$result
}
"
)
->
save
(
$code_info
);
}
else
{
}
else
{
$Agent_code
->
add
(
$code_info
);
$Agent_code
->
add
(
$code_info
);
}
}
$action
=
"添加会员:
{
$result
}
"
;
$action
=
"添加会员:
{
$result
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'添加成功'
);
$this
->
success
(
'添加成功'
);
}
else
{
}
else
{
$this
->
error
(
'添加失败'
);
$this
->
error
(
'添加失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
$this
->
users_model
->
getError
());
$this
->
error
(
$this
->
users_model
->
getError
());
}
}
}
}
}
}
function
edit
(){
function
edit
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$userinfo
=
M
(
"users"
)
->
find
(
$id
);
$userinfo
=
M
(
"users"
)
->
find
(
$id
);
$this
->
assign
(
'userinfo'
,
$userinfo
);
$this
->
assign
(
'userinfo'
,
$userinfo
);
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
(
":edit"
);
$this
->
display
(
":edit"
);
}
}
function
edit_post
(){
function
edit_post
(){
if
(
IS_POST
){
if
(
IS_POST
){
$user
=
M
(
"users"
);
$user
=
M
(
"users"
);
$user
->
create
();
$user
->
create
();
$avatar
=
$_POST
[
'avatar'
];
$avatar
=
$_POST
[
'avatar'
];
$id
=
$_POST
[
'id'
];
$id
=
$_POST
[
'id'
];
if
(
$avatar
==
''
){
if
(
$avatar
==
''
){
$user
->
avatar
=
'/default.jpg'
;
$user
->
avatar
=
'/default.jpg'
;
$user
->
avatar_thumb
=
'/default_thumb.jpg'
;
$user
->
avatar_thumb
=
'/default_thumb.jpg'
;
}
else
if
(
strpos
(
$avatar
,
'http'
)
===
0
){
}
else
if
(
strpos
(
$avatar
,
'http'
)
===
0
){
/* 绝对路径 */
/* 绝对路径 */
$user
->
avatar
=
$avatar
;
$user
->
avatar
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
}
else
if
(
strpos
(
$avatar
,
'/'
)
===
0
){
}
else
if
(
strpos
(
$avatar
,
'/'
)
===
0
){
/* 本地图片 */
/* 本地图片 */
$user
->
avatar
=
$avatar
;
$user
->
avatar
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
$user
->
avatar_thumb
=
$avatar
;
}
else
{
}
else
{
/* 七牛 */
/* 七牛 */
//$user->avatar= $avatar.'?imageView2/2/w/600/h/600'; //600 X 600
//$user->avatar= $avatar.'?imageView2/2/w/600/h/600'; //600 X 600
//$user->avatar_thumb= $avatar.'?imageView2/2/w/200/h/200'; // 200 X 200
//$user->avatar_thumb= $avatar.'?imageView2/2/w/200/h/200'; // 200 X 200
}
}
$result
=
$user
->
save
();
$result
=
$user
->
save
();
if
(
$result
!==
false
){
if
(
$result
!==
false
){
$this
->
delCache
(
$id
);
$this
->
delCache
(
$id
);
$action
=
"修改会员信息:
{
$id
}
"
;
$action
=
"修改会员信息:
{
$id
}
"
;
...
@@ -594,11 +596,11 @@ class IndexadminController extends AdminbaseController {
...
@@ -594,11 +596,11 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'修改失败'
);
$this
->
error
(
'修改失败'
);
}
}
}
}
}
}
// 修改倍数
// 修改倍数
function
rg_multiple_edit
(){
function
rg_multiple_edit
(){
if
(
IS_POST
){
if
(
IS_POST
){
$id
=
intval
(
$_POST
[
'id'
]);
$id
=
intval
(
$_POST
[
'id'
]);
$rg
=
intval
(
$_POST
[
'rg_multiple'
]);
$rg
=
intval
(
$_POST
[
'rg_multiple'
]);
if
(
$id
&&
$rg
)
{
if
(
$id
&&
$rg
)
{
...
@@ -614,7 +616,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -614,7 +616,7 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
}
}
/* 生成邀请码 */
/* 生成邀请码 */
function
createCode
(){
function
createCode
(){
...
@@ -639,7 +641,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -639,7 +641,7 @@ class IndexadminController extends AdminbaseController {
$proxys
=
explode
(
";"
,
$proxy
[
'path'
]);
$proxys
=
explode
(
";"
,
$proxy
[
'path'
]);
//去除最后一项空值
//去除最后一项空值
unset
(
$proxys
[
count
(
$proxys
)
-
1
]);
unset
(
$proxys
[
count
(
$proxys
)
-
1
]);
foreach
(
$proxys
as
$k
=>
$v
)
{
foreach
(
$proxys
as
$k
=>
$v
)
{
$id
=
intval
(
$v
);
$id
=
intval
(
$v
);
...
@@ -657,7 +659,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -657,7 +659,7 @@ class IndexadminController extends AdminbaseController {
}
}
$proxy_str
.=
$nk
.
"(
{
$id
}
)
{
$s
}
"
;
$proxy_str
.=
$nk
.
"(
{
$id
}
)
{
$s
}
"
;
}
}
}
}
$cuser
=
$Users
->
where
(
"id=
{
$uid
}
"
)
->
find
();
$cuser
=
$Users
->
where
(
"id=
{
$uid
}
"
)
->
find
();
if
(
$cuser
[
'tg_type'
]
==
1
){
if
(
$cuser
[
'tg_type'
]
==
1
){
...
@@ -680,13 +682,13 @@ class IndexadminController extends AdminbaseController {
...
@@ -680,13 +682,13 @@ class IndexadminController extends AdminbaseController {
//修改主播归属
//修改主播归属
function
belong_post
(){
function
belong_post
(){
if
(
IS_POST
){
if
(
IS_POST
){
$users
=
M
(
"users"
);
$users
=
M
(
"users"
);
$proxys
=
M
(
'users_proxy'
);
$proxys
=
M
(
'users_proxy'
);
$uid
=
intval
(
$_POST
[
'uid'
]);
$uid
=
intval
(
$_POST
[
'uid'
]);
$one_id
=
intval
(
$_POST
[
'one_id'
]);
//一级代理
$one_id
=
intval
(
$_POST
[
'one_id'
]);
//一级代理
$two_id
=
intval
(
$_POST
[
'two_id'
]);
//二级代理
$two_id
=
intval
(
$_POST
[
'two_id'
]);
//二级代理
$three_id
=
intval
(
$_POST
[
'three_id'
]);
//主播
$three_id
=
intval
(
$_POST
[
'three_id'
]);
//主播
...
@@ -694,36 +696,36 @@ class IndexadminController extends AdminbaseController {
...
@@ -694,36 +696,36 @@ class IndexadminController extends AdminbaseController {
$new_path
=
''
;
$new_path
=
''
;
$user
=
$users
->
where
(
"(tg_type=1 or tg_type=4) and id=
{
$uid
}
"
)
->
find
();
//当前用户或者主播
$user
=
$users
->
where
(
"(tg_type=1 or tg_type=4) and id=
{
$uid
}
"
)
->
find
();
//当前用户或者主播
if
(
$user
){
if
(
$user
){
//当前平台管理id
//当前平台管理id
$ad
=
setpath
(
$_SESSION
[
'ADMIN_ID'
]);
$ad
=
setpath
(
$_SESSION
[
'ADMIN_ID'
]);
$new_path
.=
$ad
;
$new_path
.=
$ad
;
//当前归属
//当前归属
$proxy
=
$proxys
->
where
(
"uid=
{
$uid
}
"
)
->
find
();
$proxy
=
$proxys
->
where
(
"uid=
{
$uid
}
"
)
->
find
();
if
(
$user
[
'tg_type'
]
==
1
){
//会员
if
(
$user
[
'tg_type'
]
==
1
){
//会员
if
(
$one_id
){
if
(
$one_id
){
$new_path
.=
setpath
(
$one_id
);
$new_path
.=
setpath
(
$one_id
);
}
}
if
(
$two_id
){
if
(
$two_id
){
$new_path
.=
setpath
(
$two_id
);
$new_path
.=
setpath
(
$two_id
);
}
}
if
(
$three_id
){
if
(
$three_id
){
$new_path
.=
setpath
(
$three_id
);
$new_path
.=
setpath
(
$three_id
);
}
}
if
(
$three_id
&&
!
$four_id
){
if
(
$three_id
&&
!
$four_id
){
$this
->
error
(
'用户不能直接归属到主播,请选择推广员'
);
$this
->
error
(
'用户不能直接归属到主播,请选择推广员'
);
return
;
return
;
}
}
if
(
$four_id
){
if
(
$four_id
){
$new_path
.=
setpath
(
$four_id
);
$new_path
.=
setpath
(
$four_id
);
}
}
$action
=
"修改用户归属信息:
{
$uid
}
,
{
$proxy
[
'path'
]
}
=>
{
$new_path
}
"
;
$action
=
"修改用户归属信息:
{
$uid
}
,
{
$proxy
[
'path'
]
}
=>
{
$new_path
}
"
;
if
(
$proxy
){
//如果存在
if
(
$proxy
){
//如果存在
$res
=
$proxys
->
where
(
"uid='
{
$uid
}
' AND type=0"
)
->
save
(
array
(
'path'
=>
$new_path
));
$res
=
$proxys
->
where
(
"uid='
{
$uid
}
' AND type=0"
)
->
save
(
array
(
'path'
=>
$new_path
));
if
(
$res
){
if
(
$res
){
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'修改成功'
);
$this
->
success
(
'修改成功'
);
}
else
{
}
else
{
...
@@ -757,7 +759,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -757,7 +759,7 @@ class IndexadminController extends AdminbaseController {
$res
=
$proxys
->
where
(
"uid='
{
$uid
}
' AND type=3"
)
->
save
(
array
(
'path'
=>
$new_path
));
$res
=
$proxys
->
where
(
"uid='
{
$uid
}
' AND type=3"
)
->
save
(
array
(
'path'
=>
$new_path
));
if
(
$res
){
if
(
$res
){
setAdminLog
(
$action
);
setAdminLog
(
$action
);
//与当前主播有关系的推广员和用户(原)
//与当前主播有关系的推广员和用户(原)
$cpath
=
$proxy
[
'path'
]
.
setpath
(
$uid
);
$cpath
=
$proxy
[
'path'
]
.
setpath
(
$uid
);
$cproxys
=
$proxys
->
where
(
"path like '%
{
$cpath
}
%'"
)
->
select
();
$cproxys
=
$proxys
->
where
(
"path like '%
{
$cpath
}
%'"
)
->
select
();
...
@@ -772,35 +774,35 @@ class IndexadminController extends AdminbaseController {
...
@@ -772,35 +774,35 @@ class IndexadminController extends AdminbaseController {
));
));
setAdminLog
(
"修改归属信息:
{
$v
[
'uid'
]
}
,
{
$cpath
}
=>
{
$rnew_path
}
"
);
setAdminLog
(
"修改归属信息:
{
$v
[
'uid'
]
}
,
{
$cpath
}
=>
{
$rnew_path
}
"
);
}
}
}
}
$this
->
success
(
'修改成功'
);
$this
->
success
(
'修改成功'
);
}
else
{
}
else
{
$this
->
error
(
'修改失败'
);
$this
->
error
(
'修改失败'
);
}
}
// $pathreplace[$uid] = $new_path;
// $pathreplace[$uid] = $new_path;
// var_dump($pathreplace);
// var_dump($pathreplace);
}
}
// $one = setpath($one_id);
// $one = setpath($one_id);
// $two = setpath($two_id);
// $two = setpath($two_id);
// $new_path1 = setpath($one).setpath($two);//当前新的归属
// $new_path1 = setpath($one).setpath($two);//当前新的归属
// $new_path2 = setpath($_SESSION['ADMIN_ID']).$new_path1;//完整的归属
// $new_path2 = setpath($_SESSION['ADMIN_ID']).$new_path1;//完整的归属
//当前归属
//当前归属
// $proxy = $proxys->where("uid={$uid}")->find();
// $proxy = $proxys->where("uid={$uid}")->find();
// if($proxy){//如果存在
// if($proxy){//如果存在
// //和当前关系有关的所有用户
// //和当前关系有关的所有用户
// }else{//不存在则新增
// }else{//不存在则新增
// }
// }
// $action="修改归属信息:{$uid} {$proxy['path']} => {$one}{$two}";
// $action="修改归属信息:{$uid} {$proxy['path']} => {$one}{$two}";
// $role_user = M('role_user');
// $role_user = M('role_user');
// //修改users表 tg_type为4
// //修改users表 tg_type为4
...
@@ -820,7 +822,7 @@ class IndexadminController extends AdminbaseController {
...
@@ -820,7 +822,7 @@ class IndexadminController extends AdminbaseController {
// }
// }
// //添加主播后台权限role
// //添加主播后台权限role
// $role_user->add(array("role_id"=>9,"user_id"=>$_POST['uid']));
// $role_user->add(array("role_id"=>9,"user_id"=>$_POST['uid']));
// setAdminLog($action);
// setAdminLog($action);
...
@@ -828,13 +830,13 @@ class IndexadminController extends AdminbaseController {
...
@@ -828,13 +830,13 @@ class IndexadminController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'修改失败'
);
$this
->
error
(
'修改失败'
);
}
}
}
}
}
}
//获取二级代理和主播
//获取二级代理和主播
function
get_two
(){
function
get_two
(){
$data
[
'html'
][
'proxy'
]
=
'<option value="0">请选择二级代理</option>'
;
$data
[
'html'
][
'proxy'
]
=
'<option value="0">请选择二级代理</option>'
;
$data
[
'html'
][
'anchor'
]
=
'<option value="0">请选择主播</option>'
;
$data
[
'html'
][
'anchor'
]
=
'<option value="0">请选择主播</option>'
;
$data
[
'state'
]
=
'error'
;
$data
[
'state'
]
=
'error'
;
$data
[
'status'
]
=
0
;
$data
[
'status'
]
=
0
;
...
@@ -865,9 +867,9 @@ class IndexadminController extends AdminbaseController {
...
@@ -865,9 +867,9 @@ class IndexadminController extends AdminbaseController {
//获取主播
//获取主播
function
get_anchor
(){
function
get_anchor
(){
$data
[
'html'
]
=
'<option value="0">请选择主播</option>'
;
$data
[
'html'
]
=
'<option value="0">请选择主播</option>'
;
$data
[
'state'
]
=
'error'
;
$data
[
'state'
]
=
'error'
;
$data
[
'status'
]
=
0
;
$data
[
'status'
]
=
0
;
...
@@ -892,6 +894,6 @@ class IndexadminController extends AdminbaseController {
...
@@ -892,6 +894,6 @@ class IndexadminController extends AdminbaseController {
//$data['html'] .= $html;
//$data['html'] .= $html;
}
}
echo
json_encode
(
$data
);
echo
json_encode
(
$data
);
}
}
}
}
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