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
96829ef1
Commit
96829ef1
authored
May 07, 2024
by
twj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/introducer
into dev
parents
9036604f
00afb6d4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
5 deletions
+60
-5
application/admin/controller/device/Chargedevice.php
application/admin/controller/device/Chargedevice.php
+25
-1
application/admin/model/users/Withdraw.php
application/admin/model/users/Withdraw.php
+1
-1
application/admin/view/device/chargedevice/index.html
application/admin/view/device/chargedevice/index.html
+5
-1
application/api/controller/Users.php
application/api/controller/Users.php
+9
-2
public/assets/js/backend/device/chargedevice.js
public/assets/js/backend/device/chargedevice.js
+4
-0
public/assets/js/backend/users/withdraw.js
public/assets/js/backend/users/withdraw.js
+16
-0
No files found.
application/admin/controller/device/Chargedevice.php
View file @
96829ef1
...
...
@@ -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
;
...
...
@@ -76,7 +77,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/model/users/Withdraw.php
View file @
96829ef1
...
...
@@ -43,7 +43,7 @@ class Withdraw extends Model
public
function
getStatusList
()
{
return
[
'-1'
=>
__
(
'Status -1'
),
'0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1'
)];
return
[
'-1'
=>
__
(
'Status -1'
),
'0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1'
)
,
'2'
=>
__
(
'Status 2'
)
];
}
public
function
getWithdrawWayList
()
...
...
application/admin/view/device/chargedevice/index.html
View file @
96829ef1
...
...
@@ -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>
...
...
application/api/controller/Users.php
View file @
96829ef1
...
...
@@ -171,6 +171,10 @@ class Users extends Api
if
(
$userinfo
[
'equity'
]
>
0
)
{
$userinfo
[
'shareholder'
]
=
1
;
}
$userinfo
[
'withdraw_rule1'
]
=
'1、每日提现审核服务时间【10:00-15:00】'
;
$userinfo
[
'withdraw_rule2'
]
=
'2、单个账户日提现金额不超过5000元,单笔提现金额不超过500元(整数提现)'
;
$userinfo
[
'withdraw_rule3'
]
=
'3、单笔提现手续费1%'
;
$this
->
success
(
'获取用户信息成功'
,
[
'userinfo'
=>
$userinfo
,
'shareholder'
=>
$userinfo
[
'shareholder'
]]);
}
...
...
@@ -275,8 +279,8 @@ class Users extends Api
$this
->
error
(
"输入金额不可大于钱包金额"
);
}
$withdrawcount
=
Withdraw
::
where
([
'user_id'
=>
$user_id
,
'status'
=>
[
'neq'
,
-
1
]])
->
whereTime
(
'start_time'
,
'today'
)
->
count
();
if
(
$withdrawcount
>=
2
0
)
{
$this
->
error
(
"每天提现不能超过
2
0次"
);
if
(
$withdrawcount
>=
1
0
)
{
$this
->
error
(
"每天提现不能超过
1
0次"
);
}
$data
=
[
'cash_sn'
=>
getOrdersn
(
'withdraw'
),
...
...
@@ -382,6 +386,9 @@ class Users extends Api
case
1
:
$val
[
'state'
]
=
'已通过'
;
break
;
case
2
:
$val
[
'state'
]
=
'已核销'
;
break
;
}
}
$this
->
success
(
'获取成功'
,
[
'total_money'
=>
$usersinfo
[
'total_money'
],
'withdraws'
=>
$Withdraws
]);
...
...
public/assets/js/backend/device/chargedevice.js
View file @
96829ef1
...
...
@@ -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
,
...
...
public/assets/js/backend/users/withdraw.js
View file @
96829ef1
...
...
@@ -160,6 +160,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
})
});
$
(
'
#batchverification
'
).
click
(
function
()
{
var
data
=
table
.
bootstrapTable
(
'
getSelections
'
);
var
id_str
=
''
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
id_str
+=
data
[
i
].
id
+
'
,
'
;
}
id_str
=
id_str
.
substr
(
0
,
id_str
.
length
-
1
);
console
.
log
(
id_str
);
$
.
get
(
'
users/withdraw/batchverification
'
,{
ids
:
id_str
},
function
(
res
)
{
if
(
res
.
code
==
1
){
layer
.
alert
(
'
批量核销成功
'
);
}
else
{
layer
.
alert
(
res
.
msg
);
}
})
});
// 为表格绑定事件
Table
.
api
.
bindevent
(
table
);
},
...
...
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