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
d518036a
Commit
d518036a
authored
Jun 04, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理后台 看板
parent
4365c1b3
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
16026 additions
and
50 deletions
+16026
-50
Withdrawal.php
app/admin/controller/caiwu/Withdrawal.php
+10
-2
Project.php
app/admin/controller/project/Project.php
+54
-6
User.php
app/admin/controller/users/User.php
+61
-2
UserValidate.php
app/admin/validate/UserValidate.php
+24
-0
index.html
app/admin/view/caiwu/withdrawal/index.html
+4
-0
index.html
app/admin/view/project/project/index.html
+3
-1
editmoney.html
app/admin/view/users/user/editmoney.html
+85
-0
index.html
app/admin/view/users/user/index.html
+41
-1
usermoneylog.html
app/admin/view/users/user/usermoneylog.html
+1
-0
Project.php
app/api/controller/manage/Project.php
+24
-24
ProjectService.php
app/api/service/ProjectService.php
+7
-7
UserMoneyLog.php
app/model/project/UserMoneyLog.php
+22
-5
UserWithdrawal.php
app/model/project/UserWithdrawal.php
+1
-1
app.php
config/app.php
+1
-1
element-icons.ttf
public/static/admin/element/fonts/element-icons.ttf
+0
-0
element-icons.woff
public/static/admin/element/fonts/element-icons.woff
+0
-0
index.css
public/static/admin/element/index.css
+15681
-0
index.js
public/static/admin/element/index.js
+1
-0
vue.min.js
public/static/admin/element/vue.min.js
+6
-0
No files found.
app/admin/controller/caiwu/Withdrawal.php
View file @
d518036a
...
...
@@ -103,7 +103,11 @@ class Withdrawal extends AdminBase
$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'
]);
$res
=
User
::
where
(
'id'
,
$txinfo
[
'user_id'
])
->
setInc
(
'money'
,
$txinfo
[
'tx_money'
]);
if
(
!
$res
){
Db
::
rollback
();
throw
new
\Exception
(
'余额变动失败'
);
}
}
$updatedata
[
'sh_status'
]
=
$shstatus
;
...
...
@@ -150,7 +154,11 @@ class Withdrawal extends AdminBase
$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'
]);
$res
=
User
::
where
(
'id'
,
$txinfo
[
'user_id'
])
->
setInc
(
'money'
,
$txinfo
[
'tx_money'
]);
if
(
!
$res
){
Db
::
rollback
();
throw
new
\Exception
(
'余额变动失败'
);
}
}
$updatedata
[
'dk_status'
]
=
$shstatus
;
...
...
app/admin/controller/project/Project.php
View file @
d518036a
...
...
@@ -12,6 +12,8 @@ namespace app\admin\controller\project;
use
app\admin\controller\AdminBase
;
use
app\model\Project
as
ProjectModel
;
use
app\model\project\User
;
use
app\model\project\UserMoneyLog
;
use
think\App
;
use
think\facade\Db
;
use
app\model\projectCategory
;
...
...
@@ -58,7 +60,7 @@ class Project extends AdminBase
if
(
isset
(
$post
[
'user'
])
&&
!
empty
(
$post
[
'user'
]))
{
$hasmap
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$post
[
'user'
]
.
'%'
];
}
$list
=
$this
->
project
->
where
(
$map
)
->
hasWhere
(
'getuserdata'
,
$hasmap
)
->
with
([
'projectcatedata'
,
'getuserdata'
])
->
append
([
'sh_status_text'
,
'status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
$list
=
$this
->
project
->
where
(
$map
)
->
hasWhere
(
'getuserdata'
,
$hasmap
)
->
with
([
'projectcatedata'
,
'getuserdata'
])
->
append
([
'sh_status_text'
,
'status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$category
=
projectCategory
::
field
(
'*,pid as parentid'
)
->
order
(
'sort desc'
)
->
select
()
->
toArray
();
...
...
@@ -73,9 +75,9 @@ class Project extends AdminBase
$post
=
input
();
$result
=
$this
->
project
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
if
(
$result
)
{
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
if
(
$result
)
{
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
return
$this
->
returnMsg
(
'修改成功'
);
}
}
...
...
@@ -96,7 +98,7 @@ class Project extends AdminBase
public
function
detail
()
{
$post
=
input
();
$info
=
$this
->
project
->
where
(
'id'
,
$post
[
'id'
])
->
with
([
'projectcatedata'
,
'getuserdata'
])
->
find
()
->
append
([
'sh_status_text'
,
'status_text'
,
'tag_title'
,
'file_list'
]);
$info
=
$this
->
project
->
where
(
'id'
,
$post
[
'id'
])
->
with
([
'projectcatedata'
,
'getuserdata'
])
->
find
()
->
append
([
'sh_status_text'
,
'status_text'
,
'tag_title'
,
'file_list'
]);
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
...
...
@@ -107,7 +109,7 @@ class Project extends AdminBase
{
$post
=
input
();
if
(
$this
->
request
->
isAjax
())
{
if
(
$this
->
request
->
isAjax
())
{
$data
[
'is_hot'
]
=
isset
(
$post
[
'is_hot'
])
?
$post
[
'is_hot'
]
:
0
;
$data
[
'is_tj'
]
=
isset
(
$post
[
'is_tj'
])
?
$post
[
'is_tj'
]
:
0
;
...
...
@@ -126,6 +128,7 @@ class Project extends AdminBase
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
2
;
$updatedata
[
'status'
]
=
1
;
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
...
...
@@ -146,5 +149,50 @@ class Project extends AdminBase
return
$this
->
returnMsg
(
"操作失败"
);
}
}
//审核
public
function
shenheproject1111111
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
2
;
$updatedata
[
'status'
]
=
1
;
try
{
Db
::
startTrans
();
$projectinfo
=
$this
->
project
->
lock
(
true
)
->
find
(
$post
[
'id'
]);
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
Db
::
rollback
();
throw
new
\Exception
(
'请输入失败原因'
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
1
;
$updatedata
[
'status'
]
=
0
;
$credit_money
=
User
::
where
([
'id'
=>
$projectinfo
[
'user_id'
]])
->
value
(
'credit_money'
);
//退回信用金额到用户
$res
=
User
::
where
([
'id'
=>
$projectinfo
[
'user_id'
]])
->
setInc
(
'credit_money'
,
$projectinfo
[
'yusuan'
]);
if
(
!
$res
)
{
Db
::
rollback
();
throw
new
\Exception
(
'用户信用金额更新失败'
);
}
UserMoneyLog
::
addUserMoneyLog
(
$projectinfo
[
'user_id'
],
$projectinfo
[
'yusuan'
],
$credit_money
,
3
,
'项目【'
.
$projectinfo
[
'title'
]
.
'】审核失败:'
.
$errordesc
,
$projectinfo
[
'id'
],
1
);
}
$updatedata
[
'sh_status'
]
=
$shstatus
;
$updatedata
[
'sh_status_desc'
]
=
$errordesc
;
$updatedata
[
'sh_status_time'
]
=
time
();
//项目审核时间
$projectinfo
->
save
(
$updatedata
);
Db
::
commit
();
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
$this
->
returnMsg
(
$e
->
getMessage
());
}
}
}
\ No newline at end of file
app/admin/controller/users/User.php
View file @
d518036a
...
...
@@ -3,9 +3,12 @@
namespace
app\admin\controller\users
;
use
app\admin\controller\AdminBase
;
use
app\admin\validate\UserValidate
;
use
app\model\project\User
as
UserModel
;
use
app\model\project\UserSmrz
;
use
think\App
;
use
think\facade\Db
;
use
app\model\project\UserMoneyLog
;
class
User
extends
AdminBase
{
...
...
@@ -56,14 +59,14 @@ class User extends AdminBase
public
function
detail
()
{
$post
=
input
();
$info
=
$this
->
user
->
where
(
'id'
,
$post
[
'id'
])
->
find
(
);
$info
=
$this
->
user
->
find
(
$post
[
'id'
]
);
$smrzinfo
=
UserSmrz
::
where
([
'user_id'
=>
$post
[
'id'
],
'status'
=>
2
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
$this
->
assign
(
'smrzinfo'
,
$smrzinfo
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//
会员详情
//
资金记录
public
function
usermoneylog
()
{
$this
->
assign
(
'limit'
,
10
);
...
...
@@ -98,5 +101,61 @@ class User extends AdminBase
}
//编辑余额
public
function
editmoney
()
{
$post
=
input
();
if
(
$this
->
request
->
isAjax
())
{
$vo
=
(
new
UserValidate
())
->
goCheck
([
'user_id'
,
'change_money'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
try
{
Db
::
startTrans
();
$userinfo
=
$this
->
user
->
lock
(
true
)
->
find
(
$post
[
'user_id'
]);
if
(
$userinfo
[
'role'
]
==
1
)
{
if
(
$post
[
'change_money'
]
<
0
&&
$userinfo
[
'money'
]
<
abs
(
$post
[
'change_money'
]))
{
Db
::
rollback
();
throw
new
\Exception
(
'余额不足'
);
}
//普通用户
$usermoney
=
$userinfo
[
'money'
];
$money_type
=
0
;
//增加余额
$res
=
$userinfo
->
setInc
(
'money'
,
$post
[
'change_money'
]);
}
else
{
if
(
$post
[
'change_money'
]
<
0
&&
$userinfo
[
'credit_money'
]
<
abs
(
$post
[
'change_money'
]))
{
Db
::
rollback
();
throw
new
\Exception
(
'余额不足'
);
}
$usermoney
=
$userinfo
[
'credit_money'
];
$money_type
=
1
;
//增加信用分
$res
=
$userinfo
->
setInc
(
'credit_money'
,
$post
[
'change_money'
]);
}
if
(
!
$res
)
{
Db
::
rollback
();
throw
new
\Exception
(
'余额变动失败'
);
}
UserMoneyLog
::
addUserMoneyLog
(
$userinfo
[
'id'
],
$post
[
'change_money'
],
$usermoney
,
2
,
'后台调整金额'
,
0
,
$money_type
);
Db
::
commit
();
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
$this
->
returnMsg
(
$e
->
getMessage
());
}
}
$user
=
$this
->
user
->
find
(
$post
[
'id'
]);
$this
->
assign
(
'user'
,
$user
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/validate/UserValidate.php
0 → 100644
View file @
d518036a
<?php
namespace
app\admin\validate
;
use
think\Validate
;
use
app\model
;
use
app\api\validate\BaseValidate
;
class
UserValidate
extends
BaseValidate
{
protected
$rule
=
[
'user_id'
=>
'require'
,
'change_money'
=>
'require'
,
];
protected
$message
=
[
'user_id.require'
=>
'用户不能为空'
,
'change_money.require'
=>
'变动金额不能为空'
,
];
}
\ No newline at end of file
app/admin/view/caiwu/withdrawal/index.html
View file @
d518036a
...
...
@@ -278,12 +278,14 @@
function
shajax
(
id
,
shstatus
,
errordesc
=
''
){
var
loadindex
=
layer
.
load
();
$
.
ajax
({
method
:
"post"
,
url
:
app_root
+
'/shenhewithdrawal'
,
data
:
{
id
:
id
,
shstatus
:
shstatus
,
errordesc
:
errordesc
},
dataType
:
"json"
,
success
:
function
(
res
){
layer
.
close
(
loadindex
);
if
(
res
.
code
===
1
)
{
layer
.
msg
(
res
.
msg
,{
icon
:
1
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
layer
.
closeAll
();
...
...
@@ -301,12 +303,14 @@
}
function
dkajax
(
id
,
shstatus
,
errordesc
=
''
){
var
loadindex
=
layer
.
load
();
$
.
ajax
({
method
:
"post"
,
url
:
app_root
+
'/dakuanwithdrawal'
,
data
:
{
id
:
id
,
shstatus
:
shstatus
,
errordesc
:
errordesc
},
dataType
:
"json"
,
success
:
function
(
res
){
layer
.
close
(
loadindex
);
if
(
res
.
code
===
1
)
{
layer
.
msg
(
res
.
msg
,{
icon
:
1
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
layer
.
closeAll
();
...
...
app/admin/view/project/project/index.html
View file @
d518036a
...
...
@@ -75,7 +75,9 @@
<
div
class
=
"layui-clear-space"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"detail"
>
详情
<
/a
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"shenhei"
>
审核
<
/a
>
{{
#
if
(
d
.
sh_status
===
0
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"shenhei"
>
审核
<
/a
>
{{
#
}
}}
<
a
class
=
"layui-btn layui-btn-xs layui-btn-danger"
lay
-
event
=
"del"
>
删除
<
/a
>
<
/div
>
...
...
app/admin/view/users/user/editmoney.html
0 → 100644
View file @
d518036a
{extend name="base/header" /}
{block name="body"}
<style>
.layui-tab-content
{
margin-right
:
15px
;}
.el-cascader
{
width
:
100%
;}
</style>
<div
style=
"margin: 0px 20px 0px 0px"
>
<form
class=
"layui-form "
style=
"margin-top: 20px;"
id=
"fjfrom"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
用户昵称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
autocomplete=
"off"
class=
"layui-input"
value=
"{$user.username}"
readonly
disabled
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
用户手机号
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
autocomplete=
"off"
class=
"layui-input"
value=
"{$user.mobile}"
readonly
disabled
>
</div>
</div>
{if $user.role == 1}
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
用户余额
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
autocomplete=
"off"
class=
"layui-input"
value=
"{$user.money}"
readonly
disabled
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
加减余额
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"change_money"
autocomplete=
"off"
class=
"layui-input"
value=
""
>
<div
class=
"layui-form-mid"
><i
class=
"layui-icon"
>
</i>
增加请填写正数,减少请填写负数
</div>
</div>
</div>
{else/}
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
信用分
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
autocomplete=
"off"
class=
"layui-input"
value=
"{$user.credit_money}"
readonly
disabled
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
加减信用分
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"change_money"
autocomplete=
"off"
class=
"layui-input"
value=
""
/>
<div
class=
"layui-form-mid"
><i
class=
"layui-icon"
>
</i>
增加请填写正数,减少请填写负数
</div>
</div>
</div>
{/if}
<input
type=
"hidden"
name=
"user_id"
value=
"{$user.id|default=0}"
>
</form>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'tagsInput'
,
'buildItems'
,
'form'
,
'laydate'
,
'util'
],
function
()
{
var
form
=
layui
.
form
;
var
inputTags
=
layui
.
tagsInput
;
form
.
render
();
$
(
"#inputTags"
).
tagsInput
();
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/admin/view/users/user/index.html
View file @
d518036a
...
...
@@ -124,6 +124,9 @@
data
:
[{
title
:
'资金记录'
,
id
:
'monelog'
},{
title
:
'编辑余额'
,
id
:
'editmoney'
},{
title
:
'重置密码'
,
id
:
'restpwd'
...
...
@@ -139,7 +142,7 @@
layer
.
confirm
(
'确定要重置【'
+
data
.
username
+
'】的密码为123456?'
,
function
(){
$
.
ajax
({
method
:
"post"
,
url
:
layui
.
cache
.
maps
+
'/user/resetpwd'
,
url
:
layui
.
cache
.
maps
+
'/user
s.user
/resetpwd'
,
data
:
{
id
:
id
},
dataType
:
"json"
,
success
:
function
(
res
){
...
...
@@ -155,6 +158,9 @@
});
});
}
else
if
(
menudata
.
id
===
'editmoney'
){
//增加余额
editmoneyopen
(
id
);
}
else
if
(
menudata
.
id
===
'del'
){
del
(
id
);
}
...
...
@@ -204,5 +210,39 @@
});
}
/**/
function
editmoneyopen
(
id
=
''
){
layer
.
open
({
type
:
2
,
area
:
[
'500px'
,
'450px'
],
title
:
'编辑余额'
,
btn
:
[
'确定'
,
'关闭'
],
content
:
'/admin/users.user/editmoney?id='
+
id
,
yes
:
function
(
index
,
layero
){
var
loadindex
=
layer
.
load
();
var
data
=
window
[
"layui-layer-iframe"
+
index
].
callbackdata
();
$
.
ajax
({
method
:
"post"
,
url
:
layui
.
cache
.
maps
+
'/users.user/editmoney'
,
data
:
data
,
dataType
:
"json"
,
success
:
function
(
res
){
layer
.
close
(
loadindex
);
if
(
res
.
code
===
1
)
{
layer
.
msg
(
res
.
msg
,{
icon
:
1
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
layer
.
closeAll
();
table
.
reloadData
(
'user'
);
});
}
else
{
layer
.
msg
(
res
.
msg
,{
icon
:
2
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
});
}
}
});
},
});
}
/**/
});
</script>
\ No newline at end of file
app/admin/view/users/user/usermoneylog.html
View file @
d518036a
...
...
@@ -32,6 +32,7 @@
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
:
'money_type'
,
align
:
'center'
,
width
:
100
,
title
:
'金额类型'
},
{
field
:
'front_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改前金额'
},
{
field
:
'money'
,
align
:
'center'
,
width
:
100
,
title
:
'金额'
},
{
field
:
'after_money'
,
align
:
'center'
,
width
:
100
,
title
:
'更改后金额'
},
...
...
app/api/controller/manage/Project.php
View file @
d518036a
...
...
@@ -10,6 +10,7 @@ use app\api\validate\ProjectValidate;
use
app\BaseController
;
use
app\model\Project
as
ProjectModel
;
use
app\model\project\User
as
UserModel
;
use
app\model\project\UserMoneyLog
;
use
app\model\ProjectPut
;
use
think\facade\Db
;
use
think\Log
;
...
...
@@ -94,9 +95,8 @@ class Project extends BaseController
$data
=
$request
->
only
(
$filed
);
$res
=
ProjectModel
::
where
([
'id'
=>
$data
[
'project_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
if
(
!
$res
)
{
$res
=
ProjectModel
::
where
([
'id'
=>
$data
[
'project_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
if
(
!
$res
)
{
return
$this
->
returnMsg
(
'项目不存在'
);
}
...
...
@@ -104,9 +104,9 @@ class Project extends BaseController
$completeProgress
=
(
$res
->
sh_status
==
2
)
?
(
StatusConstants
::
PROGRESS_RULES
[
'complete'
][
$res
->
status
]
??
0
)
:
0
;
$res
->
progress
=
max
(
1
,
min
(
100
,
$applyProgress
+
$completeProgress
));
$res
=
UtilService
::
infoWithTags
(
$res
,
\app\model\ProjectTag
::
class
,
'tag_ids'
);
$res
=
UtilService
::
infoWithTags
(
$res
,
\app\model\ProjectTag
::
class
,
'tag_ids'
);
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
}
...
...
@@ -124,14 +124,13 @@ class Project extends BaseController
$page
=
$request
->
param
(
'page/d'
,
1
);
$pageSize
=
$request
->
param
(
'pageSize/d'
,
10
);
$where
=
[
'project_id'
=>
$data
[
'project_id'
]];
$where
=
[
'project_id'
=>
$data
[
'project_id'
]];
$query
=
ProjectPut
::
with
([
'getuserdata'
])
->
where
(
$where
);
$order_status
=
ProjectModel
::
where
(
'id'
,
$request
->
param
(
'project_id'
))
->
value
(
'status'
);
if
(
$order_status
>=
2
)
{
$query
->
where
([
'project_put.status'
=>
2
]);
$order_status
=
ProjectModel
::
where
(
'id'
,
$request
->
param
(
'project_id'
))
->
value
(
'status'
);
if
(
$order_status
>=
2
)
{
$query
->
where
([
'project_put.status'
=>
2
]);
}
...
...
@@ -149,11 +148,11 @@ class Project extends BaseController
]);
$list
->
each
(
function
(
$item
)
{
$item
->
done_num
=
ProjectPut
::
where
([
'user_id'
=>
$item
->
user_id
,
'complete_status'
=>
3
])
->
count
();;
$item
->
done_num
=
ProjectPut
::
where
([
'user_id'
=>
$item
->
user_id
,
'complete_status'
=>
3
])
->
count
();;
return
$item
;
});
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
...
...
@@ -168,10 +167,9 @@ class Project extends BaseController
return
$vo
;
}
$data
=
$request
->
only
(
$filed
);
$res
=
ProjectService
::
confirmCompletion
(
$data
[
'project_put_id'
]);
if
(
$res
[
'code'
]
==
1
)
{
return
$this
->
returnMsg
(
'success'
,
1
);
$res
=
ProjectService
::
confirmCompletion
(
$data
[
'project_put_id'
]);
if
(
$res
[
'code'
]
==
1
)
{
return
$this
->
returnMsg
(
'success'
,
1
);
}
return
$this
->
returnMsg
(
$res
[
'msg'
]);
...
...
@@ -203,7 +201,7 @@ class Project extends BaseController
}
// 更新项目状态
$projectUpdate
=
[
'status'
=>
2
,
'updatetime'
=>
time
(),
'put_time'
=>
time
()];
$projectUpdate
=
[
'status'
=>
2
,
'updatetime'
=>
time
(),
'put_time'
=>
time
()];
$projectResult
=
ProjectModel
::
where
(
'id'
,
$data
[
'project_id'
])
->
update
(
$projectUpdate
);
...
...
@@ -270,12 +268,13 @@ class Project extends BaseController
throw
new
\Exception
(
'企业信用金额不足,当前可用金额:'
.
$user
->
credit_money
);
}
// 1. 创建项目
$res
=
ProjectModel
::
create
(
$data
);
if
(
!
$res
)
{
throw
new
\Exception
(
'项目创建失败'
);
}
$project_id
=
$res
->
id
;
// 2. 更新用户金额(扣除预算)
$moneyResult
=
UserModel
::
where
([
'id'
=>
$request
->
userId
,
'is_del'
=>
0
])
->
dec
(
'credit_money'
,
$data
[
'yusuan'
])
...
...
@@ -283,7 +282,8 @@ class Project extends BaseController
if
(
!
$moneyResult
)
{
throw
new
\Exception
(
'企业信用金额更新失败'
);
}
//增加信用金额记录
UserMoneyLog
::
addUserMoneyLog
(
$request
->
userId
,
'-'
.
$data
[
'yusuan'
],
$user
[
'credit_money'
],
3
,
'发布项目:【'
.
$data
[
'title'
]
.
'】'
,
$project_id
,
2
);
// 提交事务
Db
::
commit
();
...
...
@@ -301,7 +301,7 @@ class Project extends BaseController
//编辑项目
public
function
editProject
(
Request
$request
)
{
$filed
=
[
'project_id'
,
'title'
,
'cate_id'
,
'tag_ids'
,
'yusuan'
,
'zhouqi'
,
'description'
,
'content'
,
'file_id_str'
];
$filed
=
[
'project_id'
,
'title'
,
'cate_id'
,
'tag_ids'
,
'yusuan'
,
'zhouqi'
,
'description'
,
'content'
,
'file_id_str'
];
$vo
=
(
new
ProjectValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
...
...
@@ -312,8 +312,8 @@ class Project extends BaseController
$id
=
$data
[
'project_id'
];
unset
(
$data
[
'project_id'
]);
$res
=
ProjectModel
::
where
([
'id'
=>
$id
,
'user_id'
=>
$request
->
userId
])
->
update
(
$data
);
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
$res
=
ProjectModel
::
where
([
'id'
=>
$id
,
'user_id'
=>
$request
->
userId
])
->
update
(
$data
);
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
}
...
...
@@ -329,13 +329,13 @@ class Project extends BaseController
$data
=
$request
->
only
(
$filed
);
$res
=
ProjectModel
::
where
([
'id'
=>
$data
[
'project_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
$res
=
ProjectModel
::
where
([
'id'
=>
$data
[
'project_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
if
(
!
$res
)
{
return
$this
->
returnMsg
(
'项目不存在或无权删除'
);
}
$res
->
delete
();
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
return
$this
->
returnMsg
(
'success'
,
1
,
$res
);
}
...
...
app/api/service/ProjectService.php
View file @
d518036a
...
...
@@ -63,13 +63,13 @@ class ProjectService
}
// 7. 恢复企业高校信用额度
$moneyResult
=
UserModel
::
where
([
'id'
=>
$user
[
'id'
],
'is_del'
=>
0
])
->
inc
(
'credit_money'
,
$projectData
[
'yusuan'
])
->
update
();
if
(
!
$moneyResult
)
{
throw
new
\Exception
(
'企业信用金额更新失败'
);
}
//
$moneyResult = UserModel::where(['id' => $user['id'], 'is_del' => 0])
//
->inc('credit_money', $projectData['yusuan'])
//
->update();
//
//
if (!$moneyResult) {
//
throw new \Exception('企业信用金额更新失败');
//
}
// 8. 记录资金流水
$logResult
=
UserMoneyLog
::
addUserMoneyLog
(
...
...
app/model/project/UserMoneyLog.php
View file @
d518036a
...
...
@@ -74,13 +74,13 @@ class UserMoneyLog extends Model
* @param $gl_table_id
* @return UserMoneyLog
*/
public
static
function
addUserMoneyLog
(
$user_id
,
$money
,
$front_money
,
$type
,
$content
=
''
,
$gl_table_id
=
0
)
public
static
function
addUserMoneyLog
(
$user_id
,
$money
,
$front_money
,
$type
,
$content
=
''
,
$gl_table_id
=
0
,
$money_type
=
0
)
{
$after_money
=
$money
+
$front_money
;
$after_money
=
$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
]);
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
,
'money_type'
=>
$money_type
]);
}
...
...
@@ -100,6 +100,9 @@ class UserMoneyLog extends Model
case
2
:
$text
=
'后台操作'
;
break
;
case
3
:
$text
=
'发布项目'
;
break
;
default
:
$text
=
'项目结算'
;
...
...
@@ -107,4 +110,18 @@ class UserMoneyLog extends Model
return
$text
;
}
public
function
getMoneyTypeAttr
(
$value
,
$data
)
{
switch
(
$value
)
{
case
1
:
$text
=
'信用分'
;
break
;
default
:
$text
=
'余额'
;
}
return
$text
;
}
}
\ No newline at end of file
app/model/project/UserWithdrawal.php
View file @
d518036a
...
...
@@ -143,7 +143,7 @@ class UserWithdrawal extends Model
$statustxt
=
'已打款'
;
break
;
default
:
$statustxt
=
'等待审核'
;
$statustxt
=
$data
[
'sh_status'
]
==
2
?
'待打款'
:
'等待审核'
;
}
return
$statustxt
;
...
...
config/app.php
View file @
d518036a
...
...
@@ -32,5 +32,5 @@ return [
'error_message'
=>
'页面错误!请稍后再试~'
,
// 显示错误信息
'show_error_msg'
=>
false
,
'file_http_url'
=>
'http://192.168.4.2
9
:8082'
,
'file_http_url'
=>
'http://192.168.4.2
22
:8082'
,
];
\ No newline at end of file
public/static/admin/element/fonts/element-icons.ttf
0 → 100644
View file @
d518036a
File added
public/static/admin/element/fonts/element-icons.woff
0 → 100644
View file @
d518036a
File added
public/static/admin/element/index.css
0 → 100644
View file @
d518036a
This diff is collapsed.
Click to expand it.
public/static/admin/element/index.js
0 → 100644
View file @
d518036a
This diff is collapsed.
Click to expand it.
public/static/admin/element/vue.min.js
0 → 100644
View file @
d518036a
This diff is collapsed.
Click to expand it.
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