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
9d5a4b6b
Commit
9d5a4b6b
authored
Mar 24, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1e3a7f0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
209 additions
and
207 deletions
+209
-207
admin/themes/simplebootx/Admin/Charge/index.html
+3
-1
application/Admin/Controller/ChargeController.class.php
+206
-206
No files found.
admin/themes/simplebootx/Admin/Charge/index.html
View file @
9d5a4b6b
...
...
@@ -7,6 +7,7 @@
</ul>
<form
class=
"well form-search"
name=
"form1"
method=
"post"
style=
"float:left"
action=
""
>
<!--
<if condition="$showlevel eq 0">
代理商:
<select class="select_2" name="proxyid" id="proxyid">
...
...
@@ -19,9 +20,10 @@
<option value="">全部</option>
<volist name="promoterlist" id="v">
<option value="{$v['id']}" <if condition="$formget.promoterid eq $v['id']">selected</if> >{$v['user_nicename']}</option>
</volist>
</volist>
</select>
</if>
-->
订单状态:
<select
class=
"select_2"
name=
"status"
>
<option
value=
""
>
全部
</option>
...
...
application/Admin/Controller/ChargeController.class.php
View file @
9d5a4b6b
...
...
@@ -24,26 +24,186 @@ class ChargeController extends AdminbaseController {
)
);
function
index
(){
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$role_id
=
$_SESSION
[
'role_id'
];
$isshowset
=
1
;
if
(
!
sp_auth_check
(
$adminid
,
'admin/charge/setpay'
)){
$isshowset
=
0
;
}
$this
->
assign
(
'isshowset'
,
$isshowset
);
$Proxy
=
M
(
'users_proxy'
);
/* 代理业务员 */
$showlevel
=
'0'
;
if
(
$role_id
==
6
){
//一级代理
$showlevel
=
'1'
;
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'7'
;
$path
=
setpath
(
$adminid
);
$uids
=
$Proxy
->
where
(
"type=-1 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$where
[
'u.id'
]
=
array
(
'in'
,
$uids
);
$promoterlist
=
M
(
'users u'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
field
(
'u.id,u.user_login,user_nicename'
)
->
where
(
$where
)
->
order
(
"u.create_time DESC"
)
->
select
();
foreach
(
$promoterlist
as
$k
=>
$v
){
if
(
$v
[
'user_nicename'
]
==
''
){
$v
[
'user_nicename'
]
=
$v
[
'user_login'
];
}
$promoterlist
[
$k
]
=
$v
;
}
}
else
if
(
$role_id
==
8
){
//二级dial
}
else
if
(
$role_id
==
7
){
//业务员
$showlevel
=
'2'
;
}
else
if
(
$role_id
==
9
){
//主播
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'6'
;
$proxylistj
=
[];
$proxylist
=
M
(
'users u'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
field
(
'u.id,u.user_login,u.user_nicename'
)
->
where
(
$where
)
->
order
(
"u.create_time DESC"
)
->
select
();
foreach
(
$proxylist
as
$k
=>
$v
){
if
(
$v
[
'user_nicename'
]
==
''
){
$v
[
'user_nicename'
]
=
$v
[
'user_login'
];
}
$where2
[
'user_type'
]
=
'1'
;
$path
=
setpath
(
$v
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=-1 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$where2
[
'id'
]
=
array
(
'in'
,
$uids
);
$promoterlistj
=
[];
$promoterlist2
=
M
(
'users'
)
->
field
(
'id,user_login,user_nicename'
)
->
where
(
$where2
)
->
order
(
"create_time DESC"
)
->
select
();
foreach
(
$promoterlist2
as
$k2
=>
$v2
){
if
(
$v2
[
'user_nicename'
]
==
''
){
$v2
[
'user_nicename'
]
=
$v2
[
'user_login'
];
}
$promoterlistj
[
$v2
[
'id'
]]
=
$v2
;
}
$v
[
'list'
]
=
$promoterlistj
;
$proxylistj
[
$v
[
'id'
]]
=
$v
;
}
}
$this
->
assign
(
'proxylistj'
,
json_encode
(
$proxylistj
));
$this
->
assign
(
'promoterlist'
,
$promoterlist
);
$this
->
assign
(
'showlevel'
,
$showlevel
);
if
(
$role_id
==
6
||
$role_id
==
7
||
$role_id
==
8
||
$role_id
==
9
||
$_REQUEST
[
'proxyid'
]
!=
''
||
$_REQUEST
[
'promoterid'
]
!=
''
){
if
(
$_REQUEST
[
'proxyid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'proxyid'
];
$_GET
[
'proxyid'
]
=
$_REQUEST
[
'proxyid'
];
}
if
(
$_REQUEST
[
'promoterid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'promoterid'
];
$_GET
[
'promoterid'
]
=
$_REQUEST
[
'promoterid'
];
}
$path
=
setpath
(
$adminid
);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
}
if
(
$_REQUEST
[
'status'
]
!=
''
){
$map
[
'status'
]
=
$_REQUEST
[
'status'
];
$_GET
[
'status'
]
=
$_REQUEST
[
'status'
];
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
$charge
=
M
(
"users_charge"
);
$count
=
$charge
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$lists
=
$charge
->
where
(
$map
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
$moneysum
=
$charge
->
where
(
$map
)
->
sum
(
"money"
);
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
}
$this
->
assign
(
'moneysum'
,
$moneysum
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
'status'
,
$this
->
status
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
'ambient'
,
$this
->
ambient
);
$this
->
display
();
}
// function index(){
//
// $adminid=$_SESSION['ADMIN_ID'];
// $role_id=$_SESSION['role_id'];
//
// $isshowset=1;
// if(!sp_auth_check($adminid,'admin/charge/setpay')){
// $isshowset=0;
// }
// $this->assign('isshowset', $isshowset);
//
// $Proxy=M('users_proxy');
//
// /* 代理业务员 */
//
// $showlevel='0';
// if($role_id==6){//一级代理
// $showlevel='1';
//
// $where['u.user_type']='1';
// $where['r.role_id']='7';
//
// $path=setpath($adminid);
// $uids=$Proxy->where("type=-1 and path like '%{$path}%'")->getField('uid',true);
// if(!$uids){
...
...
@@ -64,12 +224,9 @@ class ChargeController extends AdminbaseController {
// }
// $promoterlist[$k]=$v;
// }
// }else if($role_id==8){//二级dial
//
// }else if($role_id==7){//业务员
// }else if($role_id==7){
// $showlevel='2';
// }else if($role_id==9){//主播
//
// }else{
// $where['u.user_type']='1';
// $where['r.role_id']='6';
// $proxylistj=[];
...
...
@@ -108,30 +265,22 @@ class ChargeController extends AdminbaseController {
// $proxylistj[$v['id']]=$v;
// }
// }
//
// $this->assign('proxylistj', json_encode($proxylistj));
// $this->assign('promoterlist', $promoterlist);
// $this->assign('showlevel', $showlevel);
//
// if($role_id==6 || $role_id==7 || $role_id==8 || $role_id==9 || $_REQUEST['proxyid']!='' || $_REQUEST['promoterid']!=''){
//
// if($_REQUEST['proxyid']!=''){
// $adminid=$_REQUEST['proxyid'];
//
$_GET['proxyid']=$_REQUEST['proxyid'];
// $_GET['proxyid']=$_REQUEST['proxyid'];
// }
//
// if($_REQUEST['promoterid']!=''){
// $adminid=$_REQUEST['promoterid'];
// $_GET['promoterid']=$_REQUEST['promoterid'];
// }
//
// $path=setpath($adminid);
// $uids=$Proxy->where("
type=0 and
path like '%{$path}%'")->getField('uid',true);
// $uids=$Proxy->where("path like '%{$path}%'")->getField('uid',true);
// if(!$uids){
// $uids=[];
// array_push($uids,'0');
// }
// $map['uid'] = array('in',$uids);
// $map['
to
uid'] = array('in',$uids);
// }
//
// if($_REQUEST['status']!=''){
...
...
@@ -142,206 +291,57 @@ class ChargeController extends AdminbaseController {
// $map['addtime']=array("gt",strtotime($_REQUEST['start_time']));
// $_GET['start_time']=$_REQUEST['start_time'];
// }
//
// if($_REQUEST['end_time']!=''){
//
// $map['addtime']=array("lt",strtotime($_REQUEST['end_time']));
// $_GET['end_time']=$_REQUEST['end_time'];
// }
// if($_REQUEST['start_time']!='' && $_REQUEST['end_time']!='' ){
//
// $map['addtime']=array("between",array(strtotime($_REQUEST['start_time']),strtotime($_REQUEST['end_time'])));
// $_GET['start_time']=$_REQUEST['start_time'];
// $_GET['end_time']=$_REQUEST['end_time'];
// }
//
// if($_REQUEST['keyword']!=''){
// $map['uid|orderno
|trade_no
']=array("like","%".$_REQUEST['keyword']."%");
// $map['uid|orderno']=array("like","%".$_REQUEST['keyword']."%");
// $_GET['keyword']=$_REQUEST['keyword'];
// }
//
// $charge=M("users_charge");
// $count=$charge->where($map)->count();
// $page = $this->page($count, 20);
// $lists = $charge
// ->where($map)
// ->order("addtime DESC")
// ->limit($page->firstRow . ',' . $page->listRows)
// ->select();
// $map['is_sure'] = 1;
//
// $moneysum = $charge
// ->where($map)
// ->sum("money");
// $charge=M("users_charge2");
// $count=$charge->where($map)->count();
// $page = $this->page($count, 20);
// $lists = $charge
// ->where($map)
// ->order("addtime DESC")
// ->limit($page->firstRow . ',' . $page->listRows)
// ->select();
//
// foreach($lists as $k=>$v){
// $userinfo=M("users")->field("user_nicename")->where("id='$v[uid]'")->find();
// $lists[$k]['userinfo']= $userinfo;
//
// }
// foreach($lists as $k=>$v){
// $userinfo=M("users")->field("user_nicename")->where("id='$v[uid]'")->find();
// $lists[$k]['userinfo']= $userinfo;
// $userinfo2=M("users")->field("user_nicename")->where("id='$v[touid]'")->find();
// if(empty($userinfo2)){
// $userinfo3 = '平台';
// } else {
// $userinfo3 = $userinfo2['user_nicename'] . ' ( '.$v['touid'].' )';
// }
// $lists[$k]['userinfo2'] = $userinfo3;
// }
//
// $moneysum = $charge
// ->where($map)
// ->sum("money");
//
//
$this->assign('moneysum', $moneysum);
//
$this->assign('lists', $lists);
//
$this->assign('formget', $_GET);
//
$this->assign("page", $page->show('Admin'));
//
$this->assign('moneysum', $moneysum);
//
$this->assign('lists', $lists);
//
$this->assign('formget', $_GET);
//
$this->assign("page", $page->show('Admin'));
//
// $this->assign('status', $this->status);
// $this->assign('type', $this->type);
// $this->assign('ambient', $this->ambient);
// $this->assign('status', array("0"=>"未确认","1"=>"已确认"));
//
//
$this->display(
);
//
$this->display('index2'
);
// }
function
index
(){
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$role_id
=
$_SESSION
[
'role_id'
];
$Proxy
=
M
(
'users_proxy'
);
$showlevel
=
'0'
;
if
(
$role_id
==
6
){
//一级代理
$showlevel
=
'1'
;
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'7'
;
$path
=
setpath
(
$adminid
);
$uids
=
$Proxy
->
where
(
"type=-1 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$where
[
'u.id'
]
=
array
(
'in'
,
$uids
);
$promoterlist
=
M
(
'users u'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
field
(
'u.id,u.user_login,user_nicename'
)
->
where
(
$where
)
->
order
(
"u.create_time DESC"
)
->
select
();
foreach
(
$promoterlist
as
$k
=>
$v
){
if
(
$v
[
'user_nicename'
]
==
''
){
$v
[
'user_nicename'
]
=
$v
[
'user_login'
];
}
$promoterlist
[
$k
]
=
$v
;
}
}
else
if
(
$role_id
==
7
){
$showlevel
=
'2'
;
}
else
{
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'6'
;
$proxylistj
=
[];
$proxylist
=
M
(
'users u'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
field
(
'u.id,u.user_login,u.user_nicename'
)
->
where
(
$where
)
->
order
(
"u.create_time DESC"
)
->
select
();
foreach
(
$proxylist
as
$k
=>
$v
){
if
(
$v
[
'user_nicename'
]
==
''
){
$v
[
'user_nicename'
]
=
$v
[
'user_login'
];
}
$where2
[
'user_type'
]
=
'1'
;
$path
=
setpath
(
$v
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=-1 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$where2
[
'id'
]
=
array
(
'in'
,
$uids
);
$promoterlistj
=
[];
$promoterlist2
=
M
(
'users'
)
->
field
(
'id,user_login,user_nicename'
)
->
where
(
$where2
)
->
order
(
"create_time DESC"
)
->
select
();
foreach
(
$promoterlist2
as
$k2
=>
$v2
){
if
(
$v2
[
'user_nicename'
]
==
''
){
$v2
[
'user_nicename'
]
=
$v2
[
'user_login'
];
}
$promoterlistj
[
$v2
[
'id'
]]
=
$v2
;
}
$v
[
'list'
]
=
$promoterlistj
;
$proxylistj
[
$v
[
'id'
]]
=
$v
;
}
}
if
(
$role_id
==
6
||
$role_id
==
7
||
$role_id
==
8
||
$role_id
==
9
||
$_REQUEST
[
'proxyid'
]
!=
''
||
$_REQUEST
[
'promoterid'
]
!=
''
){
if
(
$_REQUEST
[
'proxyid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'proxyid'
];
$_GET
[
'proxyid'
]
=
$_REQUEST
[
'proxyid'
];
}
if
(
$_REQUEST
[
'promoterid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'promoterid'
];
$_GET
[
'promoterid'
]
=
$_REQUEST
[
'promoterid'
];
}
$path
=
setpath
(
$adminid
);
$uids
=
$Proxy
->
where
(
"path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
!
$uids
){
$uids
=
[];
array_push
(
$uids
,
'0'
);
}
$map
[
'touid'
]
=
array
(
'in'
,
$uids
);
}
if
(
$_REQUEST
[
'status'
]
!=
''
){
$map
[
'status'
]
=
$_REQUEST
[
'status'
];
$_GET
[
'status'
]
=
$_REQUEST
[
'status'
];
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
$map
[
'is_sure'
]
=
1
;
$charge
=
M
(
"users_charge2"
);
$count
=
$charge
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$lists
=
$charge
->
where
(
$map
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
$userinfo2
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[touid]
'"
)
->
find
();
if
(
empty
(
$userinfo2
)){
$userinfo3
=
'平台'
;
}
else
{
$userinfo3
=
$userinfo2
[
'user_nicename'
]
.
' ( '
.
$v
[
'touid'
]
.
' )'
;
}
$lists
[
$k
][
'userinfo2'
]
=
$userinfo3
;
}
$moneysum
=
$charge
->
where
(
$map
)
->
sum
(
"money"
);
$this
->
assign
(
'moneysum'
,
$moneysum
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
'status'
,
array
(
"0"
=>
"未确认"
,
"1"
=>
"已确认"
));
$this
->
display
(
'index2'
);
}
function
setPay2
(){
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
...
...
@@ -416,7 +416,7 @@ class ChargeController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
)));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
...
...
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