Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangtao
projecttwo
Commits
de4c25ca
Commit
de4c25ca
authored
May 22, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务板块api接口
parent
8fe739f6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
438 additions
and
62 deletions
+438
-62
UserMoneyLog.php
app/admin/controller/caiwu/UserMoneyLog.php
+78
-0
Withdrawal.php
app/admin/controller/caiwu/Withdrawal.php
+81
-37
User.php
app/admin/controller/users/User.php
+8
-0
index.html
app/admin/view/caiwu/user_money_log/index.html
+144
-0
index.html
app/admin/view/caiwu/withdrawal/index.html
+19
-17
index.html
app/admin/view/users/user/index.html
+16
-2
usermoneylog.html
app/admin/view/users/user/usermoneylog.html
+62
-0
Advert.php
app/model/project/Advert.php
+1
-1
UserMoneyLog.php
app/model/project/UserMoneyLog.php
+24
-1
UserWithdrawal.php
app/model/project/UserWithdrawal.php
+5
-4
No files found.
app/admin/controller/caiwu/UserMoneyLog.php
0 → 100644
View file @
de4c25ca
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\caiwu
;
use
app\admin\controller\AdminBase
;
use
think\App
;
use
think\facade\Db
;
use
app\model\project\UserMoneyLog
as
UserMoneyLogModel
;
use
app\model\project\User
;
/**
* 后台主控制器
*/
class
UserMoneyLog
extends
AdminBase
{
protected
$usermoneylog
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
usermoneylog
=
new
UserMoneyLogModel
();
}
// 列表
public
function
index
(
string
$do
=
''
)
{
$limit
=
10
;
if
(
$do
==
'json'
)
{
$post
=
input
();
$post
[
'limit'
]
=
isset
(
$post
[
'limit'
])
?
$post
[
'limit'
]
:
$limit
;
$map
=
[];
$hasmap
=
[];
if
(
isset
(
$post
[
'kw'
])
&&
!
empty
(
$post
[
'kw'
]))
{
$map
[]
=
[
'content'
,
'like'
,
'%'
.
$post
[
'kw'
]
.
'%'
];
}
if
(
isset
(
$post
[
'type'
])
&&
$post
[
'type'
]
>
-
1
)
{
$map
[]
=
[
'type'
,
'='
,
$post
[
'type'
]];
}
if
(
isset
(
$post
[
'user_id'
])
&&
!
empty
(
$post
[
'user_id'
]))
{
$map
[]
=
[
'user_id'
,
'='
,
$post
[
'user_id'
]];
}
if
(
isset
(
$post
[
'user'
])
&&
!
empty
(
$post
[
'user'
]))
{
$hasmap
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$post
[
'user'
]
.
'%'
];
}
$list
=
$this
->
usermoneylog
->
where
(
$map
)
->
hasWhere
(
'getuserdata'
,
$hasmap
)
->
with
([
'getuserdata'
])
->
append
([
'type_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$this
->
assign
(
'limit'
,
$limit
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
public
function
del
()
{
$post
=
input
();
$ids
=
is_array
(
$post
[
'id'
])
?
implode
(
','
,
$post
[
'id'
])
:
$post
[
'id'
];
if
(
$this
->
usermoneylog
->
destroy
([
$ids
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
}
\ No newline at end of file
app/admin/controller/caiwu/Withdrawal.php
View file @
de4c25ca
...
...
@@ -14,6 +14,8 @@ use app\admin\controller\AdminBase;
use
think\App
;
use
think\facade\Db
;
use
app\model\project\UserWithdrawal
;
use
app\model\project\UserMoneyLog
;
use
app\model\project\User
;
/**
* 后台主控制器
...
...
@@ -28,7 +30,6 @@ class Withdrawal extends AdminBase
parent
::
__construct
(
$app
);
$this
->
withdrawal
=
new
UserWithdrawal
();
}
// 列表
...
...
@@ -43,13 +44,19 @@ class Withdrawal extends AdminBase
$map
=
[];
$hasmap
=
[];
if
(
isset
(
$post
[
'kw'
])
&&
!
empty
(
$post
[
'kw'
]))
{
$map
[]
=
[
'title'
,
'like'
,
'%'
.
$post
[
'kw'
]
.
'%'
];
$map
[]
=
[
'sn'
,
'like'
,
'%'
.
$post
[
'kw'
]
.
'%'
];
}
if
(
isset
(
$post
[
'sh_status'
])
&&
$post
[
'sh_status'
]
>
-
1
)
{
$map
[]
=
[
'sh_status'
,
'='
,
$post
[
'sh_status'
]];
}
if
(
isset
(
$post
[
'dk_status'
])
&&
$post
[
'dk_status'
]
>
-
1
)
{
$map
[]
=
[
'dk_status'
,
'='
,
$post
[
'dk_status'
]];
}
if
(
isset
(
$post
[
'
cate_id'
])
&&
!
empty
(
$post
[
'cate_id
'
]))
{
$
map
[]
=
[
'cate_id'
,
'='
,
$post
[
'cate_id'
]
];
if
(
isset
(
$post
[
'
user'
])
&&
!
empty
(
$post
[
'user
'
]))
{
$
hasmap
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$post
[
'user'
]
.
'%'
];
}
$list
=
$this
->
withdrawal
->
where
(
$map
)
->
with
([
'getuserdata'
])
->
append
([
'sh_status_text'
,
'dk_status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
$list
=
$this
->
withdrawal
->
where
(
$map
)
->
hasWhere
(
'getuserdata'
,
$hasmap
)
->
with
([
'getuserdata'
])
->
append
([
'sh_status_text'
,
'dk_status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$this
->
assign
(
'limit'
,
$limit
);
...
...
@@ -57,7 +64,6 @@ class Withdrawal extends AdminBase
}
public
function
del
()
{
$post
=
input
();
...
...
@@ -70,55 +76,93 @@ class Withdrawal extends AdminBase
}
//审核
public
function
shenhewithdrawal
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
2
;
if
(
$post
[
'shstatus'
]
==
1
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
try
{
Db
::
startTrans
();
$txinfo
=
$this
->
withdrawal
->
where
(
'id'
,
$post
[
'id'
])
->
lock
(
true
)
->
find
();
if
(
$txinfo
[
'sh_status'
]
!=
0
)
{
throw
new
\Exception
(
'记录已审核'
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
1
;
}
$updatedata
[
'sh_status'
]
=
$shstatus
;
$updatedata
[
'sh_status_desc'
]
=
$errordesc
;
$errordesc
=
''
;
$shstatus
=
2
;
if
(
$post
[
'shstatus'
]
==
1
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
// return $this->returnMsg("请输入失败原因");
throw
new
\Exception
(
'请输入失败原因'
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
1
;
//增加记录
$usermoney
=
User
::
where
([
'id'
=>
$txinfo
[
'user_id'
]])
->
value
(
'money'
);
UserMoneyLog
::
addUserMoneyLog
(
$txinfo
[
'user_id'
],
$txinfo
[
'tx_money'
],
$usermoney
,
1
,
'审核驳回:'
.
$errordesc
,
$txinfo
[
'id'
]);
//退回余额到用户
User
::
where
(
'user_id'
,
$txinfo
[
'user_id'
])
->
Inc
(
'money'
,
$txinfo
[
'tx_money'
]);
$result
=
$this
->
withdrawal
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
}
$updatedata
[
'sh_status'
]
=
$shstatus
;
$updatedata
[
'sh_status_desc'
]
=
$errordesc
;
// $this->withdrawal->where('id', $post['id'])->update($updatedata);
$txinfo
->
save
(
$updatedata
);
Db
::
commit
();
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
$this
->
returnMsg
(
$e
->
getMessage
());
}
}
//打款
public
function
dakuanwithdrawal
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
3
;
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
try
{
Db
::
startTrans
();
$txinfo
=
$this
->
withdrawal
->
lock
(
true
)
->
find
(
$post
[
'id'
]);
if
(
$txinfo
[
'sh_status'
]
!=
2
)
{
throw
new
\Exception
(
'请先审核再打款'
);
}
if
(
$txinfo
[
'dk_status'
]
>
1
)
{
throw
new
\Exception
(
'记录已处理,请不要重复处理'
);
}
$errordesc
=
''
;
$shstatus
=
3
;
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
throw
new
\Exception
(
'请输入失败原因'
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
2
;
//增加记录
$usermoney
=
User
::
where
([
'id'
=>
$txinfo
[
'user_id'
]])
->
value
(
'money'
);
UserMoneyLog
::
addUserMoneyLog
(
$txinfo
[
'user_id'
],
$txinfo
[
'tx_money'
],
$usermoney
,
1
,
'打款驳回:'
.
$errordesc
,
$txinfo
[
'id'
]);
//退回余额到用户
User
::
where
(
'user_id'
,
$txinfo
[
'user_id'
])
->
Inc
(
'money'
,
$txinfo
[
'tx_money'
]);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
2
;
}
$updatedata
[
'dk_status'
]
=
$shstatus
;
$updatedata
[
'dk_status_desc'
]
=
$errordesc
;
$updatedata
[
'dk_time'
]
=
time
();
$result
=
$this
->
withdrawal
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
$updatedata
[
'dk_status'
]
=
$shstatus
;
$updatedata
[
'dk_status_desc'
]
=
$errordesc
;
$updatedata
[
'dk_time'
]
=
time
();
$txinfo
->
save
(
$updatedata
);
Db
::
commit
();
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
$this
->
returnMsg
(
$e
->
getMessage
());
}
}
}
\ No newline at end of file
app/admin/controller/users/User.php
View file @
de4c25ca
...
...
@@ -63,6 +63,14 @@ class User extends AdminBase
return
$this
->
fetch
(
''
,
''
,
false
);
}
//会员详情
public
function
usermoneylog
()
{
$this
->
assign
(
'limit'
,
10
);
$this
->
assign
(
'user_id'
,
request
()
->
param
(
'user_id'
));
return
$this
->
fetch
(
''
,
''
,
false
);
}
public
function
del
()
{
...
...
app/admin/view/caiwu/user_money_log/index.html
0 → 100644
View file @
de4c25ca
<div
class=
"layui-fluid"
>
<style>
#usermoneylogcategoryTreeBar
{
padding
:
10px
15px
;
border
:
1px
solid
#e6e6e6
;
background-color
:
#f2f2f2
}
#usermoneylogcategoryTree
{
border
:
1px
solid
#e6e6e6
;
border-top
:
none
;
padding
:
10px
5px
;
overflow
:
auto
;
height
:
-webkit-calc
(
100vh
-
290px
);
height
:
-moz-calc
(
100vh
-
290px
);
height
:
calc
(
100vh
-
290px
)}
.layui-tree-entry
.layui-tree-txt
{
padding
:
0
5px
;
border
:
1px
transparent
solid
;
text-decoration
:
none
!important
}
.layui-tree-entry.organ-tree-click
.layui-tree-txt
{
background-color
:
#fff3e0
;
border
:
1px
#ffe6b0
solid
}
.files_itemwusermoneylog
{
width
:
30px
;
height
:
30px
;
line-height
:
30px
;
cursor
:
pointer
;
padding
:
1px
;
background
:
#fff
;
display
:
-webkit-box
;
-moz-box-align
:
center
;
-webkit-box-align
:
center
;
-moz-box-pack
:
center
;
-webkit-box-pack
:
center
;}
.files_itemwusermoneylog
img
{
max-width
:
28px
;
max-height
:
28px
;
border
:
0
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
<form
class=
"layui-form render"
>
<input
type=
"hidden"
name=
"groupid"
id=
"usermoneylog-groupid"
value=
""
/>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"提现单号"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"user"
placeholder=
"用户名,用户手机"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"type"
>
<option
value=
"-1"
>
类型
</option>
<option
value=
"0"
>
项目结算
</option>
<option
value=
"1"
>
用户提现
</option>
<option
value=
"2"
>
后台操作
</option>
</select>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-btn-group"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"search-usermoneylog"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-usermoneylog-all"
onclick=
"$('#usermoneylog-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"usermoneylog"
id=
"usermoneylog"
></table>
</div>
</div>
</div>
<!--JS部分-->
<script>
layui
.
use
([
'vinfo'
,
'buildItems'
,
'dropdown'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'caiwu.user_money_log/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
/*渲染数据*/
table
.
render
({
elem
:
'#usermoneylog'
,
page
:
true
,
limit
:{
$limit
},
height
:
'full-341'
,
url
:
app_root
+
"index?&do=json"
,
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'username'
,
align
:
'center'
,
width
:
150
,
title
:
'用户名'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'mobile'
,
align
:
'center'
,
width
:
120
,
title
:
'用户手机'
,
templet
:
'<div>{{= d.getuserdata.mobile}}</div>'
},
{
field
:
'front_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改前金额'
},
{
field
:
'money'
,
align
:
'center'
,
width
:
100
,
title
:
'金额'
},
{
field
:
'after_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改后金额'
},
{
field
:
'type_text'
,
align
:
'center'
,
width
:
100
,
title
:
'类型'
},
{
field
:
'content'
,
align
:
'center'
,
title
:
'内容'
},
{
field
:
'createtime'
,
width
:
150
,
align
:
'center'
,
title
:
'时间'
},
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="usermoneylog"]'
));
}
});
// 状态 - 开关操作
form
.
on
(
'switch(is_sell-chang)'
,
function
(
obj
){
var
json
=
JSON
.
parse
(
decodeURIComponent
(
$
(
this
).
data
(
'json'
)));
var
av
=
obj
.
elem
.
checked
?
1
:
0
;
admin
.
req
(
app_root
+
"editup"
,{
id
:
json
.
id
,
av
:
av
,
af
:
obj
.
elem
.
name
},
function
(
res
){
layer
.
tips
(
res
.
msg
,
obj
.
othis
,{
time
:
1000
});
if
(
res
.
code
===
0
)
obj
.
elem
.
checked
=
parseInt
(
obj
.
value
);
},
'post'
,{
headersToken
:
true
});
});
/*快编监听*/
table
.
on
(
'edit(usermoneylog)'
,
function
(
obj
){
admin
.
req
(
app_root
+
"editup"
,{
id
:
obj
.
data
.
id
,
av
:
obj
.
value
,
af
:
obj
.
field
},
function
(
res
){
layer
.
msg
(
res
.
msg
,{
shade
:[
0.4
,
'#000'
],
time
:
500
});
},
'post'
,{
headersToken
:
true
});
});
/**/
/*工具条监听*/
table
.
on
(
'tool(usermoneylog)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'detail'
){
usermoneylogOpen
(
data
.
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'usermoneylog-event-image'
){
var
src
=
$
(
this
).
attr
(
'src'
),
alt
=
$
(
this
).
attr
(
'alt'
);
layer
.
photos
({
photos
:{
data
:[{
alt
:
alt
,
src
:
src
}],
start
:
'0'
},
anim
:
5
,
shade
:[
0.4
,
'#000'
]});
}
else
if
(
obj
.
event
===
'more'
){
}
});
/**/
/*删除*/
function
del
(
ids
){
layer
.
confirm
(
'确定要删除所选记录吗?'
,
function
(){
admin
.
req
(
app_root
+
"del"
,{
id
:
ids
},
function
(
res
){
layer
.
msg
(
res
.
msg
,{
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
if
(
res
.
code
==
1
)
table
.
reloadData
(
'usermoneylog'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*顶部删除按钮*/
$
(
'#usermoneylog-del'
).
on
(
'click'
,
function
(){
var
checkRows
=
table
.
checkStatus
(
'usermoneylog'
).
data
;
if
(
checkRows
.
length
===
0
){
return
layer
.
msg
(
'请选择需删除的记录'
);}
var
ids
=
checkRows
.
map
(
function
(
d
){
return
d
.
id
;});
console
.
log
(
ids
);
del
(
ids
);
});
/**/
});
</script>
\ No newline at end of file
app/admin/view/caiwu/withdrawal/index.html
View file @
de4c25ca
...
...
@@ -16,26 +16,24 @@
<input
type=
"hidden"
name=
"groupid"
id=
"withdrawal-groupid"
value=
""
/>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"
关键词
"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"
提现单号
"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"user"
placeholder=
"用户名,用户手机"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"sh_status"
>
<option
value=
""
>
审核状态
</option>
<option
value=
"0"
>
审核中
</option>
<option
value=
"
-1
"
>
审核状态
</option>
<option
value=
"0"
>
待审核
</option>
<option
value=
"1"
>
审核失败
</option>
<option
value=
"2"
>
审核通过
</option>
</select>
</div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"status"
>
<option
value=
""
>
项目状态
</option>
<option
value=
"0"
>
等待审核
</option>
<option
value=
"1"
>
招募中
</option>
<option
value=
"2"
>
进行中
</option>
<option
value=
"3"
>
待验收
</option>
<option
value=
"4"
>
已完成
</option>
<option
value=
"5"
>
已取消
</option>
<select
name=
"dk_status"
>
<option
value=
"-1"
>
打款状态
</option>
<option
value=
"0"
>
未打款
</option>
<option
value=
"1"
>
打款中
</option>
<option
value=
"2"
>
打款失败
</option>
<option
value=
"3"
>
已打款
</option>
</select>
</div>
<div
class=
"layui-inline"
>
...
...
@@ -60,8 +58,12 @@
<script
type=
"text/html"
id=
"withdrawalDemo"
>
<
div
class
=
"layui-clear-space"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"shenhei"
>
审核
<
/a
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"dakuan"
>
打款
<
/a
>
{{
#
if
(
d
.
sh_status
===
0
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"shenhei"
>
审核
<
/a
>
{{
#
}
}}
{{
#
if
(
d
.
dk_status
<
2
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"dakuan"
>
打款
<
/a
>
{{
#
}
}}
<
a
class
=
"layui-btn layui-btn-xs layui-btn-danger"
lay
-
event
=
"del"
>
删除
<
/a
>
<
/div
>
...
...
@@ -109,12 +111,12 @@
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'sn'
,
align
:
'center'
,
title
:
'提现
编
号'
},
{
field
:
'sn'
,
align
:
'center'
,
title
:
'提现
单
号'
},
{
field
:
'username'
,
align
:
'center'
,
title
:
'用户名'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'mobile'
,
align
:
'center'
,
title
:
'用户手机'
,
templet
:
'<div>{{= d.getuserdata.mobile}}</div>'
},
{
field
:
'tx_money'
,
align
:
'center'
,
title
:
'提现金额'
},
{
field
:
'tx_commission'
,
align
:
'center'
,
title
:
'提现手续费'
},
{
field
:
'tx_sj_money'
,
align
:
'center'
,
title
:
'实际到账金额'
},
{
field
:
'tx_money'
,
align
:
'center'
,
width
:
100
,
title
:
'提现金额'
},
{
field
:
'tx_commission'
,
align
:
'center'
,
width
:
100
,
title
:
'提现手续费'
},
{
field
:
'tx_sj_money'
,
align
:
'center'
,
width
:
100
,
title
:
'实际到账金额'
},
{
field
:
'account'
,
align
:
'center'
,
title
:
'提现账号'
},
{
field
:
'sh_status'
,
width
:
100
,
align
:
'center'
,
title
:
'审核状态'
,
templet
:
'#withdrawalstatus-demo'
},
{
field
:
'status'
,
width
:
100
,
align
:
'center'
,
title
:
'打款状态'
,
templet
:
'#withdrawaldk-demo'
},
...
...
app/admin/view/users/user/index.html
View file @
de4c25ca
...
...
@@ -133,10 +133,10 @@
}],
click
:
function
(
menudata
){
if
(
menudata
.
id
===
'monelog'
){
usermoneylogOpen
(
id
);
}
else
if
(
menudata
.
id
===
'restpwd'
){
layer
.
confirm
(
'确定要重置【'
+
data
.
username
+
'】的密码
吗
?'
,
function
(){
layer
.
confirm
(
'确定要重置【'
+
data
.
username
+
'】的密码
为123456
?'
,
function
(){
$
.
ajax
({
method
:
"post"
,
url
:
layui
.
cache
.
maps
+
'/user/resetpwd'
,
...
...
@@ -192,5 +192,19 @@
});
}
/**/
function
usermoneylogOpen
(
id
=
''
,
type
=
''
){
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'600px'
],
title
:
'资金记录'
,
btn
:
[
'确定'
,
'关闭'
],
fixed
:
false
,
//不固定
content
:
'/admin/users.user/usermoneylog?user_id='
+
id
+
'&type='
+
type
,
yes
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
});
}
/**/
});
</script>
\ No newline at end of file
app/admin/view/users/user/usermoneylog.html
0 → 100644
View file @
de4c25ca
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
</style>
<div
style=
"margin: 0px 10px;"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"usermoneylog"
id=
"usermoneylog"
></table>
</div>
</div>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'buildItems'
,
'form'
,
'laydate'
,
'util'
],
function
()
{
var
form
=
layui
.
form
;
var
table
=
layui
.
table
;
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'caiwu.user_money_log/'
;
/*渲染数据*/
var
user_id
=
{
$user_id
};
table
.
render
({
elem
:
'#usermoneylog'
,
page
:
true
,
limit
:{
$limit
},
height
:
'450'
,
url
:
app_root
+
"index?&do=json"
,
where
:{
user_id
:
user_id
},
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
cols
:
[[
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'username'
,
align
:
'center'
,
width
:
150
,
title
:
'用户名'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'front_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改前金额'
},
{
field
:
'money'
,
align
:
'center'
,
width
:
100
,
title
:
'金额'
},
{
field
:
'after_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改后金额'
},
{
field
:
'type_text'
,
align
:
'center'
,
width
:
100
,
title
:
'类型'
},
{
field
:
'content'
,
align
:
'center'
,
minWidth
:
200
,
title
:
'内容'
},
{
field
:
'createtime'
,
width
:
150
,
align
:
'center'
,
title
:
'时间'
},
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="usermoneylog"]'
));
}
});
});
$
(
".imgclick"
).
click
(
function
(){
var
src
=
$
(
this
).
attr
(
'src'
),
alt
=
$
(
this
).
attr
(
'alt'
);
layer
.
photos
({
photos
:{
data
:[{
alt
:
alt
,
src
:
src
}],
start
:
'0'
},
anim
:
5
,
shade
:[
0.4
,
'#000'
]});
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/model/project/Advert.php
View file @
de4c25ca
...
...
@@ -17,7 +17,7 @@ class Advert extends Model
public
function
coverImg
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'cover_img_id'
)
->
where
(
'is
_
del'
,
0
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid, filename, filesize, fileurl, filetype'
);
}
public
function
getAdvcatenameAttr
(
$value
,
$data
){
...
...
app/model/project/UserMoneyLog.php
View file @
de4c25ca
...
...
@@ -78,10 +78,33 @@ class UserMoneyLog extends Model
{
$after_money
=
$money
+
$front_money
;
return
self
::
create
([
'user_id'
=>
$user_id
,
'money'
=>
$after_money
,
'front_money'
=>
$front_money
return
self
::
create
([
'user_id'
=>
$user_id
,
'money'
=>
$
money
,
'after_money'
=>
$
after_money
,
'front_money'
=>
$front_money
,
'type'
=>
$type
,
'gl_table_id'
=>
$gl_table_id
,
'createtime'
=>
time
()
,
'content'
=>
$content
]);
}
//用户信息
public
function
getuserdata
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
)
->
field
(
'username,mobile,id'
);
}
public
function
getTypeTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'type'
])
{
case
1
:
$text
=
'用户提现'
;
break
;
case
2
:
$text
=
'后台操作'
;
break
;
default
:
$text
=
'项目结算'
;
}
return
$text
;
}
}
\ No newline at end of file
app/model/project/UserWithdrawal.php
View file @
de4c25ca
...
...
@@ -18,6 +18,7 @@ class UserWithdrawal extends Model
protected
$updateTime
=
false
;
use
SoftDelete
;
protected
$deleteTime
=
'deletetime'
;
// 提现状态常量
...
...
@@ -44,7 +45,7 @@ class UserWithdrawal extends Model
* @param float $front_money 用户当前余额
* @return array
*/
public
function
applyWithdrawal
(
$userId
,
$amount
,
$accountType
,
$account
,
$realName
,
$commissionRate
=
0
,
$front_money
=
0
)
public
function
applyWithdrawal
(
$userId
,
$amount
,
$accountType
,
$account
,
$realName
,
$commissionRate
=
0
,
$front_money
=
0
)
{
// 验证提现金额
if
(
$amount
<=
0
)
{
...
...
@@ -61,7 +62,7 @@ class UserWithdrawal extends Model
$actualAmount
=
bcsub
(
$amount
,
$commission
,
2
);
// 生成提现单号
$withdrawalSn
=
UtilService
::
generateCompactOrderNo
(
$userId
,
'tx'
);
$withdrawalSn
=
UtilService
::
generateCompactOrderNo
(
$userId
,
'tx'
);
try
{
// 开启事务
...
...
@@ -82,12 +83,12 @@ class UserWithdrawal extends Model
'createtime'
=>
time
()
]);
UserModel
::
where
([
'id'
=>
$userId
,
'is_del'
=>
0
])
->
dec
(
'money'
,
$amount
)
->
save
();
UserModel
::
where
([
'id'
=>
$userId
,
'is_del'
=>
0
])
->
dec
(
'money'
,
$amount
)
->
save
();
UserMoneyLog
::
addUserMoneyLog
(
$userId
,
'-'
.
$amount
,
$front_money
,
1
,
'用户提现'
,
$withdrawalId
);
// 提交事务
$this
->
commit
();
UserMoneyLog
::
addUserMoneyLog
(
$userId
,
$amount
,
$front_money
,
1
,
'用户提现'
,
$withdrawalId
);
return
[
'status'
=>
true
,
...
...
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