Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
introducer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
introducer
Commits
02472bf8
Commit
02472bf8
authored
Mar 01, 2024
by
董先生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sousuo
parent
0509ff16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
application/admin/controller/device/Chargedevice.php
application/admin/controller/device/Chargedevice.php
+25
-1
application/admin/view/device/chargedevice/index.html
application/admin/view/device/chargedevice/index.html
+5
-1
public/assets/js/backend/device/chargedevice.js
public/assets/js/backend/device/chargedevice.js
+4
-0
No files found.
application/admin/controller/device/Chargedevice.php
View file @
02472bf8
...
...
@@ -23,6 +23,7 @@ class Chargedevice extends Backend
{
parent
::
_initialize
();
$this
->
model
=
new
\app\admin\model\device\Chargedevice
;
$this
->
Withdrawmodel
=
new
\app\admin\model\users\Withdraw
;
$this
->
Ordermodel
=
new
\app\admin\model\order\Order
;
$this
->
UsersModel
=
new
\app\admin\model\users\Users
;
$this
->
SiteModel
=
new
\app\admin\model\device\Site
;
...
...
@@ -74,7 +75,30 @@ class Chargedevice extends Backend
->
where
(
$device_where
)
->
order
(
$sort
,
$order
)
->
paginate
(
$limit
);
$result
=
[
'total'
=>
$list
->
total
(),
'rows'
=>
$list
->
items
()];
$device_money
=
28
*
365
+
14
*
365
+
14
*
365
;
$total_count
=
$this
->
model
->
where
(
$where
)
->
where
(
$device_where
)
->
where
([
'authorizestatus'
=>
2
,
'cycle'
=>
3
])
->
count
();
$total_money
=
sprintf
(
"%.2f"
,
$device_money
*
$total_count
);
$total_list
=
$this
->
model
->
where
(
$where
)
->
where
(
$device_where
)
->
where
([
'authorizestatus'
=>
2
,
'cycle'
=>
3
])
->
select
();
$sum_money
=
0
;
foreach
(
$total_list
as
$key
=>
$val
){
$Redeemed_time
=
time
()
-
$val
[
'authorizetime'
];
if
(
$Redeemed_time
>
86400
*
365
){
$remail_time
=
$Redeemed_time
-
86400
*
365
;
$sum_money
+=
28
*
365
+
14
*
ceil
(
$remail_time
/
86400
);
}
else
{
$sum_money
+=
28
*
ceil
(
$Redeemed_time
/
86400
);
}
}
$To_be_redeemed
=
sprintf
(
"%.2f"
,
$total_money
-
$sum_money
);
$result
=
[
'total'
=>
$list
->
total
(),
'rows'
=>
$list
->
items
(),
'to_be_redeemed'
=>
$To_be_redeemed
];
return
json
(
$result
);
}
...
...
application/admin/view/device/chargedevice/index.html
View file @
02472bf8
...
...
@@ -20,7 +20,11 @@
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('device/chargedevice/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-edit btn-disabled disabled {:$auth->check('device/chargedevice/edit')?'':'hide'}"
title=
"{:__('Edit')}"
><i
class=
"fa fa-pencil"
></i>
{:__('Edit')}
</a>
<a
href=
"javascript:;"
class=
"btn btn-danger btn-del btn-disabled disabled {:$auth->check('device/chargedevice/del')?'':'hide'}"
title=
"{:__('Delete')}"
><i
class=
"fa fa-trash"
></i>
{:__('Delete')}
</a>
<a
href=
"javascript:;"
class=
"btn btn-default"
style=
"font-size:14px;color:dodgerblue;"
>
<span
class=
"extend"
>
待兑付:
<i
class=
"fa fa-cny"
></i><span
id=
"to_be_redeemed"
>
0
</span>
</span>
</a>
<div
class=
"dropdown btn-group {:$auth->check('device/chargedevice/multi')?'':'hide'}"
>
<a
class=
"btn btn-primary btn-more dropdown-toggle btn-disabled disabled"
data-toggle=
"dropdown"
><i
class=
"fa fa-cog"
></i>
{:__('More')}
</a>
...
...
public/assets/js/backend/device/chargedevice.js
View file @
02472bf8
...
...
@@ -16,7 +16,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
});
var
table
=
$
(
"
#table
"
);
//当表格数据加载完成时
table
.
on
(
'
load-success.bs.table
'
,
function
(
e
,
data
)
{
$
(
"
#to_be_redeemed
"
).
text
(
data
.
to_be_redeemed
);
});
// 初始化表格
table
.
bootstrapTable
({
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
...
...
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