Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
xiaozhan
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
冷斌
xiaozhan
Commits
a5b053cf
Commit
a5b053cf
authored
Feb 20, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
28c32416
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
+42
-42
application/Admin/Controller/CashController.class.php
+42
-42
No files found.
application/Admin/Controller/CashController.class.php
View file @
a5b053cf
...
@@ -7,9 +7,9 @@ namespace Admin\Controller;
...
@@ -7,9 +7,9 @@ namespace Admin\Controller;
use
Common\Controller\AdminbaseController
;
use
Common\Controller\AdminbaseController
;
class
CashController
extends
AdminbaseController
{
class
CashController
extends
AdminbaseController
{
var
$type
=
array
(
var
$type
=
array
(
'
1
'
=>
'支付宝'
,
'
0
'
=>
'支付宝'
,
'2'
=>
'微信'
,
'2'
=>
'微信'
,
'
3
'
=>
'银行卡'
,
'
1
'
=>
'银行卡'
,
);
);
function
index
(){
function
index
(){
...
@@ -22,24 +22,24 @@ class CashController extends AdminbaseController {
...
@@ -22,24 +22,24 @@ class CashController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_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'
])));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$cashrecord
=
M
(
"users_cashrecord"
);
$cashrecord
=
M
(
"users_cashrecord"
);
$count
=
$cashrecord
->
where
(
$map
)
->
count
();
$count
=
$cashrecord
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -50,17 +50,17 @@ class CashController extends AdminbaseController {
...
@@ -50,17 +50,17 @@ class CashController extends AdminbaseController {
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
}
}
$cashrecord_total
=
$cashrecord
->
where
(
$map
)
->
sum
(
"money"
);
$cashrecord_total
=
$cashrecord
->
where
(
$map
)
->
sum
(
"money"
);
if
(
$_REQUEST
[
'status'
]
==
''
)
if
(
$_REQUEST
[
'status'
]
==
''
)
{
{
$success
=
$map
;
$success
=
$map
;
$success
[
'status'
]
=
1
;
$success
[
'status'
]
=
1
;
$fail
=
$map
;
$fail
=
$map
;
$fail
[
'status'
]
=
0
;
$fail
[
'status'
]
=
0
;
$cashrecord_success
=
$cashrecord
->
where
(
$success
)
->
sum
(
"money"
);
$cashrecord_success
=
$cashrecord
->
where
(
$success
)
->
sum
(
"money"
);
$cashrecord_fail
=
$cashrecord
->
where
(
$fail
)
->
sum
(
"money"
);
$cashrecord_fail
=
$cashrecord
->
where
(
$fail
)
->
sum
(
"money"
);
$cash
[
'success'
]
=
$cashrecord_success
;
$cash
[
'success'
]
=
$cashrecord_success
;
$cash
[
'fail'
]
=
$cashrecord_fail
;
$cash
[
'fail'
]
=
$cashrecord_fail
;
$cash
[
'type'
]
=
0
;
$cash
[
'type'
]
=
0
;
...
@@ -71,52 +71,52 @@ class CashController extends AdminbaseController {
...
@@ -71,52 +71,52 @@ class CashController extends AdminbaseController {
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
del
(){
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"users_cashrecord"
)
->
delete
(
$id
);
$result
=
M
(
"users_cashrecord"
)
->
delete
(
$id
);
if
(
$result
){
if
(
$result
){
$action
=
"删除提现记录:
{
$id
}
"
;
$action
=
"删除提现记录:
{
$id
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
();
$this
->
display
();
}
}
function
edit
(){
function
edit
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$cash
=
M
(
"users_cashrecord"
)
->
find
(
$id
);
$cash
=
M
(
"users_cashrecord"
)
->
find
(
$id
);
$cash
[
'userinfo'
]
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$cash[uid]
'"
)
->
find
();
$cash
[
'userinfo'
]
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$cash[uid]
'"
)
->
find
();
$cash
[
'auth'
]
=
M
(
"users_auth"
)
->
field
(
"*"
)
->
where
(
"uid='
$cash[uid]
'"
)
->
find
();
$cash
[
'auth'
]
=
M
(
"users_auth"
)
->
field
(
"*"
)
->
where
(
"uid='
$cash[uid]
'"
)
->
find
();
$this
->
assign
(
'cash'
,
$cash
);
$this
->
assign
(
'cash'
,
$cash
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
'type'
,
$this
->
type
);
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
();
$this
->
display
();
}
}
function
edit_post
(){
function
edit_post
(){
if
(
IS_POST
){
if
(
IS_POST
){
if
(
$_POST
[
'status'
]
==
'0'
){
if
(
$_POST
[
'status'
]
==
'0'
){
$this
->
error
(
'未修改订单状态'
);
$this
->
error
(
'未修改订单状态'
);
}
}
$cash
=
M
(
"users_cashrecord"
);
$cash
=
M
(
"users_cashrecord"
);
$cash
->
create
();
$cash
->
create
();
$cash
->
uptime
=
time
();
$cash
->
uptime
=
time
();
$result
=
$cash
->
save
();
$result
=
$cash
->
save
();
if
(
$result
){
if
(
$result
){
if
(
$_POST
[
'status'
]
==
'2'
){
if
(
$_POST
[
'status'
]
==
'2'
){
M
(
"users"
)
->
where
(
"id='"
.
$_POST
[
'uid'
]
.
"'"
)
->
setInc
(
"votes"
,
$_POST
[
'votes'
]);
M
(
"users"
)
->
where
(
"id='"
.
$_POST
[
'uid'
]
.
"'"
)
->
setInc
(
"votes"
,
$_POST
[
'votes'
]);
...
@@ -131,7 +131,7 @@ class CashController extends AdminbaseController {
...
@@ -131,7 +131,7 @@ class CashController extends AdminbaseController {
}
else
{
}
else
{
$this
->
error
(
'修改失败'
);
$this
->
error
(
'修改失败'
);
}
}
}
}
}
}
function
export
()
function
export
()
{
{
...
@@ -140,15 +140,15 @@ class CashController extends AdminbaseController {
...
@@ -140,15 +140,15 @@ class CashController extends AdminbaseController {
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_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'
])));
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
}
}
$xlsName
=
"Excel"
;
$xlsName
=
"Excel"
;
$cashrecord
=
M
(
"users_cashrecord"
);
$cashrecord
=
M
(
"users_cashrecord"
);
...
@@ -157,9 +157,9 @@ class CashController extends AdminbaseController {
...
@@ -157,9 +157,9 @@ class CashController extends AdminbaseController {
{
{
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$v
[
'uid'
]
.
")"
;
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$v
[
'uid'
]
.
")"
;
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'uptime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'uptime'
]);
$xlsData
[
$k
][
'uptime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'uptime'
]);
if
(
$v
[
'status'
]
==
'0'
){
$xlsData
[
$k
][
'status'
]
=
"处理中"
;}
else
if
(
$v
[
'status'
]
==
'2'
){
$xlsData
[
$k
][
'status'
]
=
"提现失败"
;}
else
{
$xlsData
[
$k
][
'status'
]
=
"提现完成"
;}
if
(
$v
[
'status'
]
==
'0'
){
$xlsData
[
$k
][
'status'
]
=
"处理中"
;}
else
if
(
$v
[
'status'
]
==
'2'
){
$xlsData
[
$k
][
'status'
]
=
"提现失败"
;}
else
{
$xlsData
[
$k
][
'status'
]
=
"提现完成"
;}
}
}
$action
=
"导出提现记录:"
.
M
(
"users_cashrecord"
)
->
getLastSql
();
$action
=
"导出提现记录:"
.
M
(
"users_cashrecord"
)
->
getLastSql
();
setAdminLog
(
$action
);
setAdminLog
(
$action
);
...
@@ -176,5 +176,5 @@ class CashController extends AdminbaseController {
...
@@ -176,5 +176,5 @@ class CashController extends AdminbaseController {
);
);
exportExcel
(
$xlsName
,
$xlsCell
,
$xlsData
,
$cellName
);
exportExcel
(
$xlsName
,
$xlsCell
,
$xlsData
,
$cellName
);
}
}
}
}
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