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
4fc5c753
Commit
4fc5c753
authored
Jun 27, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习资料
parent
f3a6524f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
765 additions
and
16 deletions
+765
-16
AdminBase.php
app/admin/controller/AdminBase.php
+8
-6
Index.php
app/admin/controller/Index.php
+12
-0
CertFile.php
app/admin/controller/cert/CertFile.php
+112
-0
CertOrder.php
app/admin/controller/cert/CertOrder.php
+1
-1
CertFileValidate.php
app/admin/validate/CertFileValidate.php
+22
-0
detail.html
app/admin/view/cert/cert_file/detail.html
+122
-0
edit.html
app/admin/view/cert/cert_file/edit.html
+160
-0
index.html
app/admin/view/cert/cert_file/index.html
+209
-0
index.html
app/admin/view/cert/cert_order/index.html
+46
-2
welcome.html
app/admin/view/index/welcome.html
+12
-0
Project.php
app/api/controller/project/Project.php
+5
-6
ProjectService.php
app/api/service/ProjectService.php
+1
-1
CertFile.php
app/model/CertFile.php
+47
-0
CertOrder.php
app/model/CertOrder.php
+8
-0
No files found.
app/admin/controller/AdminBase.php
View file @
4fc5c753
...
...
@@ -78,19 +78,19 @@ abstract class AdminBase extends BaseController
$controlerarr
=
explode
(
'.'
,
$controler
);
//下划线转驼峰(首字母小写)
$firstcc
=
Str
::
camel
(
$controlerarr
[
0
]);
$firstcc
=
Str
::
snake
(
$firstcc
,
$delimiter
=
'_'
);
$firstcc
=
Str
::
snake
(
$firstcc
,
$delimiter
=
'_'
);
$routeuri_controler
=
$firstcc
;
if
(
isset
(
$controlerarr
[
1
])
&&
$controlerarr
[
1
])
{
if
(
isset
(
$controlerarr
[
1
])
&&
$controlerarr
[
1
])
{
//下划线转驼峰(首字母小写)
$ss
=
Str
::
camel
(
$controlerarr
[
1
]);
$ss
=
Str
::
snake
(
$ss
,
$delimiter
=
'_'
);
$routeuri_controler
=
$controlerarr
[
0
]
.
'.'
.
$ss
;
$ss
=
Str
::
snake
(
$ss
,
$delimiter
=
'_'
);
$routeuri_controler
=
$controlerarr
[
0
]
.
'.'
.
$ss
;
}
// print_r($routeuri_controler);exit;
$this
->
routeUri
=
strtolower
(
$this
->
request
->
ADDON_APP
.
$routeuri_controler
.
"/"
.
$this
->
request
->
action
()
.
((
$action
=
$this
->
request
->
get
(
'action'
))
?
'/'
.
$action
:
''
));
$this
->
routeUri
=
strtolower
(
$this
->
request
->
ADDON_APP
.
$routeuri_controler
.
"/"
.
$this
->
request
->
action
()
.
((
$action
=
$this
->
request
->
get
(
'action'
))
?
'/'
.
$action
:
''
));
// $this->routeUri = strtolower($this->request->ADDON_APP . $this->request->controller() . "/" . $this->request->action() . (($action = $this->request->get('action')) ? '/' . $action : ''));
//验证权限
$this
->
isPower
();
...
...
@@ -142,8 +142,10 @@ abstract class AdminBase extends BaseController
*/
private
function
isPower
()
{
$actions
=
isset
(
$this
->
manUser
[
'actions'
])
?
$this
->
manUser
[
'actions'
]
:
[];
$actions
[]
=
'index/main'
;
if
(
$this
->
manUser
[
'userid'
]
>
1
&&
!
in_array
(
$this
->
routeUri
,
$actions
))
{
if
(
$this
->
manUser
[
'userid'
]
>
1
&&
!
in_array
(
$this
->
routeUri
,
$this
->
manUser
[
'actions'
]))
{
$this
->
exitMsg
(
'抱歉,您没有该项权限请联系管理员!'
,
$this
->
request
->
isAjax
()
?
401
:
400
);
}
}
...
...
app/admin/controller/Index.php
View file @
4fc5c753
...
...
@@ -29,6 +29,7 @@ class Index extends AdminBase
*/
public
function
index
()
{
$this
->
assign
([
"appMap"
=>
$this
->
appMap
,
"tokenName"
=>
$this
->
tokenName
...
...
@@ -36,6 +37,13 @@ class Index extends AdminBase
return
$this
->
fetch
(
''
,
''
,
false
);
}
public
function
welcome
()
{
return
$this
->
fetch
();
}
/**
* 后台主面板
* @return mixed
...
...
@@ -43,6 +51,10 @@ class Index extends AdminBase
public
function
main
()
{
if
(
$this
->
manUser
[
'userid'
]
>
1
&&
!
in_array
(
$this
->
routeUri
,
$this
->
manUser
[
'actions'
]))
{
$this
->
assign
(
'user'
,
$this
->
manUser
);
return
$this
->
fetch
(
'welcome'
);
}
$business_dsh_count
=
Db
::
name
(
'business'
)
->
where
([
'is_del'
=>
'0'
,
'status'
=>
0
])
->
count
();
//企业资料待审核
$school_dsh_count
=
Db
::
name
(
'school'
)
->
where
([
'is_del'
=>
'0'
,
'status'
=>
0
])
->
count
();
//学校资料待审核
...
...
app/admin/controller/cert/CertFile.php
0 → 100644
View file @
4fc5c753
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\cert
;
use
app\admin\controller\AdminBase
;
use
app\model\CertFile
as
CertFileModel
;
use
app\admin\validate\CertFileValidate
;
use
think\App
;
/**
* 后台主控制器
*/
class
CertFile
extends
AdminBase
{
protected
$certfile
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
certfile
=
new
CertFileModel
();
}
// 列表
public
function
index
(
string
$do
=
''
)
{
}
//快速编辑
public
function
editup
()
{
$post
=
input
();
$result
=
$this
->
certfile
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
if
(
$result
)
{
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
return
$this
->
returnMsg
(
'修改成功'
);
}
}
public
function
del
()
{
$post
=
input
();
$ids
=
is_array
(
$post
[
'id'
])
?
implode
(
','
,
$post
[
'id'
])
:
$post
[
'id'
];
if
(
$this
->
certfile
->
where
(
"id IN("
.
$ids
.
")"
)
->
update
([
'is_del'
=>
1
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
//编辑新增
public
function
edit
()
{
$post
=
input
();
if
(
$this
->
request
->
isPost
())
{
$check
=
(
new
CertFileValidate
())
->
goCheck
();
if
(
$check
!==
true
)
{
return
$check
;
}
try
{
$file
=
array_shift
(
$post
[
'upload'
]);
$data
[
'file_id'
]
=
$file
[
'fileid'
];
$certfileinfo
=
$this
->
certfile
->
where
(
'cert_order_id'
,
$post
[
'cert_order_id'
])
->
find
();
if
(
$certfileinfo
)
{
$msg
=
"编辑成功"
;
$certfileinfo
->
save
(
$data
);
}
else
{
$msg
=
"添加成功"
;
$data
[
'cert_order_id'
]
=
$post
[
'cert_order_id'
];
$this
->
certfile
->
create
(
$data
);
}
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
(),
0
);
}
return
$this
->
returnMsg
(
$msg
,
1
);
}
$certfileinfo
=
$this
->
certfile
->
where
(
'cert_order_id'
,
$post
[
'cert_order_id'
])
->
with
([
'certfile'
])
->
find
();
$this
->
assign
(
'certfileinfo'
,
$certfileinfo
);
$this
->
assign
(
'cert_order_id'
,
$post
[
'cert_order_id'
]);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//详情
public
function
detail
()
{
$post
=
input
();
$info
=
$this
->
certfile
->
with
([
'certdata'
,
'userprofile'
])
->
append
([
'status_text'
])
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/controller/cert/CertOrder.php
View file @
4fc5c753
...
...
@@ -51,7 +51,7 @@ class CertOrder extends AdminBase
if
(
isset
(
$post
[
'status'
])
&&
!
empty
(
$post
[
'status'
]))
{
$map
[]
=
[
'status'
,
'='
,
$post
[
'status'
]];
}
$list
=
$this
->
certorder
->
hasWhere
(
'userprofile'
,
$hasmap
)
->
hasWhere
(
'certdata'
,
$certmap
)
->
where
(
$map
)
->
with
([
'certdata'
,
'userprofile'
])
->
append
([
'status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
$list
=
$this
->
certorder
->
hasWhere
(
'userprofile'
,
$hasmap
)
->
hasWhere
(
'certdata'
,
$certmap
)
->
where
(
$map
)
->
with
([
'certdata'
,
'userprofile'
,
'certfiledata'
])
->
append
([
'status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
...
...
app/admin/validate/CertFileValidate.php
0 → 100644
View file @
4fc5c753
<?php
namespace
app\admin\validate
;
use
think\Validate
;
use
app\model
;
use
app\api\validate\BaseValidate
;
class
CertFileValidate
extends
BaseValidate
{
protected
$rule
=
[
'upload'
=>
'require'
,
];
protected
$message
=
[
'upload.require'
=>
'请上传证书附件'
,
];
}
\ No newline at end of file
app/admin/view/cert/cert_file/detail.html
0 → 100644
View file @
4fc5c753
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
</style>
<div
style=
"margin: 0px 10px;"
>
<p>
基础信息:
</p>
<table
class=
"layui-table"
>
<tbody>
<tr>
<td
class=
"widthtd"
><strong>
用户名
</strong></td>
<td>
{$info.userprofile.username}
</td>
<td
class=
"widthtd"
><strong>
用户手机号
</strong></td>
<td>
{$info.userprofile.mobile}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
证书名称
</strong></td>
<td>
{$info.certdata.title}
</td>
<td
class=
"widthtd"
><strong>
证书价格
</strong></td>
<td>
{$info.certdata.price}
</td>
</tr>
</tbody>
</table>
<p>
报名信息:
</p>
<table
class=
"layui-table"
>
<tbody>
<tr>
<td
class=
"widthtd"
><strong>
单号
</strong></td>
<td>
{$info.order_sn}
</td>
<td
class=
"widthtd"
><strong>
姓名
</strong></td>
<td>
{$info.name}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
手机号
</strong></td>
<td>
{$info.mobile}
</td>
<td
class=
"widthtd"
><strong>
身份证号
</strong></td>
<td>
{$info.idcard}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
身份证正面
</strong></td>
<td>
<img
src=
"{$info.idcard_q|default=''|get_upload_file}"
width=
"50"
height=
"50"
class=
"imgclick"
>
</td>
<td
class=
"widthtd"
><strong>
身份证背面
</strong></td>
<td>
<img
src=
"{$info.idcard_h|default=''|get_upload_file}"
width=
"50"
height=
"50"
class=
"imgclick"
>
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
邮箱
</strong></td>
<td>
{$info.email}
</td>
<td
class=
"widthtd"
><strong>
标准证件照
</strong></td>
<td>
<img
src=
"{$info.head_img_id|default=''|get_upload_file}"
width=
"50"
height=
"50"
class=
"imgclick"
>
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
其他资质
</strong></td>
<td
colspan=
"3"
>
<table
class=
"layui-table"
>
<thead>
<tr>
<th>
文件名称
</th>
<th>
大小
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
{volist name="info.other_file_list" id="data"}
<tr>
<td>
{$data.filename}
</td>
<td>
{$data.filesize}KB
</td>
<td
>
{in name="data.fileext" value="jpg,png,jpeg"}
<img
src=
"{$data.fileurl}"
width=
"50"
height=
"50"
class=
"imgclick"
>
{else/}
<a
class=
"layui-btn layui-btn-xs"
href=
"/admin/cert.cert_order/downloadfile?fileid={$data.fileid}"
target=
"_blank"
>
下载
</a>
{/in}
</td>
</tr>
{/volist}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'buildItems'
,
'form'
,
'laydate'
,
'util'
],
function
()
{
var
form
=
layui
.
form
;
/*解析顶部分组选项*/
});
$
(
".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/admin/view/cert/cert_file/edit.html
0 → 100644
View file @
4fc5c753
{extend name="base/header" /}
{block name="body"}
<style>
.layui-tab-content
{
margin-right
:
15px
;
}
.el-cascader
{
width
:
100%
;
}
</style>
<script
src=
"/static/admin/element/vue.min.js"
></script>
<!-- 引入样式 -->
<link
rel=
"stylesheet"
href=
"/static/admin/element/index.css?v=1"
>
<!-- 引入组件库 -->
<script
src=
"/static/admin/element/index.js"
></script>
<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"
>
<div>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"certupload"
>
选择文件
</button>
<div
class=
"layui-upload-list"
style=
"max-width: 1000px;"
>
<table
class=
"layui-table"
>
<colgroup>
<col>
<col
width=
"150"
>
<col
width=
"260"
>
<col
width=
"150"
>
</colgroup>
<thead>
<tr>
<th>
文件名
</th>
<th>
大小
</th>
<th>
上传进度
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody
id=
"certuploadlist"
>
{if $certfileinfo}
<tr
id=
"upload-0"
>
<td>
{$certfileinfo.certfile.filename}
<input
type=
"hidden"
name=
"upload[0][fileid]"
value=
"{$certfileinfo.certfile.fileid}"
></td>
<td>
{$certfileinfo.certfile.filesize}kb
</td>
<td><div
class=
"layui-progress"
lay-filter=
"progress-demo-0"
><div
style=
"width: 100% !important;"
class=
"layui-progress-bar"
></div></div></td>
<td>
<button
type=
"button"
class=
"layui-btn layui-btn-xs layui-btn-danger demo-delete delcss"
>
删除
</button>
</td>
</tr>
{/if}
</tbody>
</table>
</div>
<button
type=
"button"
class=
"layui-btn"
id=
"testListAction"
>
开始上传
</button>
</div>
</div>
</div>
<input
type=
"hidden"
name=
"cert_order_id"
value=
"{$cert_order_id|default=0}"
>
</form>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'buildItems'
,
'form'
,
'upload'
,
'element'
],
function
()
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
element
=
layui
.
element
;
var
upload
=
layui
.
upload
;
//演示多文件列表
var
uploadListIns
=
upload
.
render
({
elem
:
'#certupload'
,
elemList
:
$
(
'#certuploadlist'
)
//列表元素对象
,
url
:
'/admin/system.upload/upfile?action=file'
//此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
,
accept
:
'file'
,
multiple
:
true
,
number
:
1
,
auto
:
false
,
bindAction
:
'#testListAction'
,
choose
:
function
(
obj
)
{
var
that
=
this
;
var
files
=
this
.
files
=
obj
.
pushFile
();
//将每次选择的文件追加到文件队列
//读取本地文件
obj
.
preview
(
function
(
index
,
file
,
result
)
{
console
.
log
(
file
);
var
tr
=
$
([
'<tr id="upload-'
+
index
+
'">'
,
'<td>'
+
file
.
name
+
'<input type="hidden" name="upload['
+
index
+
'][name]" value="'
+
file
.
name
+
'"></td>'
,
'<td>'
+
(
file
.
size
/
1014
).
toFixed
(
1
)
+
'kb<input type="hidden" name="upload['
+
index
+
'][size]" value="'
+
(
file
.
size
/
1014
).
toFixed
(
1
)
+
'"></td>'
,
'<td><div class="layui-progress" lay-filter="progress-demo-'
+
index
+
'"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
,
'<td>'
,
'<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>'
,
'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
,
'</td>'
,
'</tr>'
].
join
(
''
));
//单个重传
tr
.
find
(
'.demo-reload'
).
on
(
'click'
,
function
()
{
obj
.
upload
(
index
,
file
);
});
//删除
tr
.
find
(
'.demo-delete'
).
on
(
'click'
,
function
()
{
delete
files
[
index
];
//删除对应的文件
tr
.
remove
();
uploadListIns
.
config
.
elem
.
next
()[
0
].
value
=
''
;
//清空 input file 值,以免删除后出现同名文件不可选
});
that
.
elemList
.
append
(
tr
);
element
.
render
(
'progress'
);
//渲染新加的进度条组件
});
}
,
done
:
function
(
res
,
index
,
upload
)
{
//成功的回调
var
that
=
this
;
//if(res.code == 0){ //上传成功
var
tr
=
that
.
elemList
.
find
(
'tr#upload-'
+
index
)
,
tds
=
tr
.
children
();
that
.
elemList
.
find
(
'tr#upload-'
+
index
).
append
(
'<input type="hidden" name="upload['
+
index
+
'][fileid]" value="'
+
res
.
data
.
fileid
+
'">'
);
tds
.
eq
(
3
).
html
(
''
);
//清空操作
delete
this
.
files
[
index
];
//删除文件队列已经上传成功的文件
return
;
//}
this
.
error
(
index
,
upload
);
}
,
allDone
:
function
(
obj
)
{
//多文件上传完毕后的状态回调
}
,
error
:
function
(
index
,
upload
)
{
//错误回调
var
that
=
this
;
var
tr
=
that
.
elemList
.
find
(
'tr#upload-'
+
index
)
,
tds
=
tr
.
children
();
tds
.
eq
(
3
).
find
(
'.demo-reload'
).
removeClass
(
'layui-hide'
);
//显示重传
}
,
progress
:
function
(
n
,
elem
,
e
,
index
)
{
//注意:index 参数为 layui 2.6.6 新增
element
.
progress
(
'progress-demo-'
+
index
,
n
+
'%'
);
//执行进度条。n 即为返回的进度百分比
}
});
});
$
(
'.delcss'
).
click
(
function
(){
$
(
this
).
parents
(
'tr'
).
remove
();
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/admin/view/cert/cert_file/index.html
0 → 100644
View file @
4fc5c753
<div
class=
"layui-fluid"
>
<style>
.files_itemadv
{
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_itemadv
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=
"certorder-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=
"cert_title"
placeholder=
"证书名称"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"status"
>
<option
value=
""
>
审核状态
</option>
<option
value=
"1"
>
申请中
</option>
<option
value=
"2"
>
申请失败
</option>
<option
value=
"3"
>
申请成功
</option>
</select>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-btn-group"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"search-certorder"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-certorder-all"
onclick=
"$('#certorder-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-box"
>
<table
lay-filter=
"certorder"
id=
"certorder"
></table>
</div>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"certorderdemo"
>
<
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
>
<!--
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"more"
>-->
<!--
更多
-->
<!--
<
i
class
=
"layui-icon layui-icon-down"
><
/i>--
>
<!--
<
/a>--
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"certorderstatus-demo"
>
{{
#
if
(
d
.
status
===
3
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs layui-btn-normal"
>
{{
=
d
.
status_text
}}
<
/a
>
{{
#
}
else
{
}}
{{
#
if
(
d
.
status
===
2
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs layui-btn-danger"
lay
-
event
=
"statuserror"
>
{{
=
d
.
status_text
}}
<
/a
>
{{
#
}
else
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
>
{{
=
d
.
status_text
}}
<
/a
>
{{
#
}
}}
{{
#
}
}}
</script>
<!--JS部分-->
<script>
layui
.
use
([
'vinfo'
,
'buildItems'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'cert.cert_order/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
var
dropdown
=
layui
.
dropdown
;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table
.
render
({
elem
:
'#certorder'
,
page
:
true
,
limit
:{
$limit
},
url
:
app_root
+
"index?&do=json"
,
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'certordername'
,
align
:
'center'
,
width
:
160
,
title
:
'用户名'
,
templet
:
'<div>{{d.userprofile.username}}</div>'
},
{
field
:
'mobile'
,
align
:
'center'
,
width
:
120
,
title
:
'用户手机号'
,
templet
:
'<div>{{d.userprofile.mobile}}</div>'
},
{
field
:
'name'
,
align
:
'center'
,
title
:
'证书名称'
,
templet
:
'<div>{{d.certdata.title}}</div>'
},
{
field
:
"status_text"
,
width
:
100
,
align
:
'center'
,
title
:
"状态"
,
templet
:
'#certorderstatus-demo'
},
{
field
:
'name'
,
align
:
'center'
,
title
:
'报名姓名'
},
{
field
:
'idcard'
,
align
:
'center'
,
title
:
'报名身份证号码'
},
{
field
:
'mobile'
,
align
:
'center'
,
title
:
'报名手机号'
},
{
field
:
'email'
,
align
:
'center'
,
title
:
'报名邮箱'
},
{
field
:
'createtime'
,
width
:
150
,
align
:
'center'
,
title
:
'创建时间'
},
{
fixed
:
'right'
,
width
:
120
,
align
:
'center'
,
templet
:
'#certorderdemo'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="certorder"]'
));
}
});
// 状态 - 开关操作
form
.
on
(
'switch(certorder-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(certorder)'
,
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(certorder)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'detail'
){
certorderOpen
(
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'certorder-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'
){
}
else
if
(
obj
.
event
===
'shenhei'
){
layer
.
confirm
(
'选择审核状态?'
,
{
btn
:
[
'审核通过'
,
'审核不通过'
],
btn1
:
function
(
index
,
layero
,
that
){
shajax
(
data
.
id
,
1
);
},
btn2
:
function
(
index
,
layero
,
that
){
layer
.
prompt
({
formType
:
2
,
value
:
''
,
title
:
'请输入失败原因'
,
},
function
(
value
,
index
,
elem
){
shajax
(
data
.
id
,
2
,
value
);
});
},
});
}
else
if
(
obj
.
event
===
'statuserror'
){
layer
.
alert
(
data
.
status_desc
,{
title
:
'失败原因'
});
}
});
/**/
/*删除*/
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
(
'certorder'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*弹出窗*/
function
certorderOpen
(
id
=
''
,
type
=
''
){
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'90%'
],
title
:
'资料详情'
,
btn
:
[
'确定'
,
'关闭'
],
fixed
:
false
,
//不固定
content
:
app_root
+
'/detail?id='
+
id
+
'&type='
+
type
,
yes
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
});
}
/**/
function
shajax
(
id
,
shstatus
,
errordesc
=
''
){
$
.
ajax
({
method
:
"post"
,
url
:
app_root
+
'/shenhecertorder'
,
data
:
{
id
:
id
,
shstatus
:
shstatus
,
errordesc
:
errordesc
},
dataType
:
"json"
,
success
:
function
(
res
){
if
(
res
.
code
===
1
)
{
layer
.
msg
(
res
.
msg
,{
icon
:
1
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
layer
.
closeAll
();
table
.
reloadData
(
'certorder'
);
});
}
else
{
layer
.
msg
(
res
.
msg
,{
icon
:
2
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
});
}
}
});
}
});
</script>
\ No newline at end of file
app/admin/view/cert/cert_order/index.html
View file @
4fc5c753
...
...
@@ -44,6 +44,11 @@
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"detail"
>
详情
<
/a
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"shenhei"
>
审核
<
/a
>
{{
#
if
(
d
.
certfiledata
)
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"uploadcert"
>
查看证书
<
/a
>
{{
#
}
else
{
}}
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"uploadcert"
>
上传证书
<
/a
>
{{
#
}
}}
<!--
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"more"
>-->
<!--
更多
-->
<!--
<
i
class
=
"layui-icon layui-icon-down"
><
/i>--
>
...
...
@@ -93,7 +98,7 @@
{
field
:
'mobile'
,
align
:
'center'
,
title
:
'报名手机号'
},
{
field
:
'email'
,
align
:
'center'
,
title
:
'报名邮箱'
},
{
field
:
'createtime'
,
width
:
150
,
align
:
'center'
,
title
:
'创建时间'
},
{
fixed
:
'right'
,
width
:
1
2
0
,
align
:
'center'
,
templet
:
'#certorderdemo'
,
title
:
'操作'
}
{
fixed
:
'right'
,
width
:
1
5
0
,
align
:
'center'
,
templet
:
'#certorderdemo'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="certorder"]'
));
...
...
@@ -122,10 +127,11 @@
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'detail'
){
certorderOpen
(
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'uploadcert'
){
uploadcert
(
id
);
}
else
if
(
obj
.
event
===
'certorder-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'
]});
...
...
@@ -182,6 +188,44 @@
});
}
/**/
/*弹出窗*/
function
uploadcert
(
id
=
''
,
type
=
''
){
var
title
=
"上传证书"
;
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'90%'
],
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
content
:
'/admin/cert.cert_file/edit?cert_order_id='
+
id
,
yes
:
function
(
index
,
layero
){
var
data
=
window
[
"layui-layer-iframe"
+
index
].
callbackdata
();
$
.
ajax
({
method
:
"post"
,
url
:
'/admin/cert.cert_file/edit'
,
data
:
data
,
dataType
:
"json"
,
success
:
function
(
res
){
if
(
res
.
code
===
1
)
{
layer
.
msg
(
res
.
msg
,{
icon
:
1
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
layer
.
close
(
index
);
table
.
reloadData
(
'certorder'
);
});
}
else
{
layer
.
msg
(
res
.
msg
,{
icon
:
2
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
});
}
// layer.closeAll();
}
});
},
});
}
/**/
function
shajax
(
id
,
shstatus
,
errordesc
=
''
){
$
.
ajax
({
method
:
"post"
,
...
...
app/admin/view/index/welcome.html
0 → 100644
View file @
4fc5c753
<div
class=
"container"
>
欢迎 {$user.username} 登录管理后台,HI 美好的一天从现在开始
</div>
<style>
.container
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
28px
;
height
:
calc
(
100vh
-
205px
);
/* 设置容器高度,确保内容在垂直方向上居中 */
}
</style>
\ No newline at end of file
app/api/controller/project/Project.php
View file @
4fc5c753
...
...
@@ -76,12 +76,11 @@ class Project extends BaseController
if
(
!
$list
)
{
$list
=
[
[
'user_id'
=>
26
,
'total_money'
=>
2998.5
,
'record_count'
=>
10
,
'user_info'
=>
[
'username'
=>
'Colin'
,
'realname'
=>
null
,
'headico'
=>
40
,
'id'
=>
1
]],
[
'user_id'
=>
27
,
'total_money'
=>
2500.0
,
'record_count'
=>
8
,
'user_info'
=>
[
'username'
=>
'Alice'
,
'realname'
=>
'Alice Smith'
,
'headico'
=>
41
,
'id'
=>
2
]],
[
'user_id'
=>
28
,
'total_money'
=>
2000.0
,
'record_count'
=>
7
,
'user_info'
=>
[
'username'
=>
'Bob'
,
'realname'
=>
'Bob Johnson'
,
'headico'
=>
42
,
'id'
=>
3
]],
[
'user_id'
=>
29
,
'total_money'
=>
1800.0
,
'record_count'
=>
6
,
'user_info'
=>
[
'username'
=>
'David'
,
'realname'
=>
'David Lee'
,
'headico'
=>
43
,
'id'
=>
4
]],
[
'user_id'
=>
33
,
'total_money'
=>
1500.0
,
'record_count'
=>
6
,
'user_info'
=>
[
'username'
=>
'张三'
,
'realname'
=>
'张三'
,
'headico'
=>
43
,
'id'
=>
4
]],
[
'user_id'
=>
34
,
'total_money'
=>
1300.0
,
'record_count'
=>
6
,
'user_info'
=>
[
'username'
=>
'李四'
,
'realname'
=>
'李四'
,
'headico'
=>
43
,
'id'
=>
4
]],
[
'user_id'
=>
26
,
'total_money'
=>
2998
,
'record_count'
=>
10
,
'user_info'
=>
[
'username'
=>
'Colin'
,
'realname'
=>
null
,
'headico'
=>
40
,
'id'
=>
1
]],
[
'user_id'
=>
27
,
'total_money'
=>
2500
,
'record_count'
=>
8
,
'user_info'
=>
[
'username'
=>
'Alice'
,
'realname'
=>
'Alice Smith'
,
'headico'
=>
41
,
'id'
=>
2
]],
[
'user_id'
=>
28
,
'total_money'
=>
2000
,
'record_count'
=>
7
,
'user_info'
=>
[
'username'
=>
'Bob'
,
'realname'
=>
'Bob Johnson'
,
'headico'
=>
42
,
'id'
=>
3
]],
[
'user_id'
=>
29
,
'total_money'
=>
1800
,
'record_count'
=>
6
,
'user_info'
=>
[
'username'
=>
'David'
,
'realname'
=>
'David Lee'
,
'headico'
=>
43
,
'id'
=>
4
]],
];
}
...
...
app/api/service/ProjectService.php
View file @
4fc5c753
...
...
@@ -248,7 +248,7 @@ class ProjectService
foreach
(
$ranking
as
&
$item
)
{
$item
[
'user_info'
]
=
$users
[
$item
[
'user_id'
]]
??
[];
// 确保完成率有值,如果没有则为0
$item
[
'completion_rate'
]
=
$item
[
'completion_rate'
]
??
0
;
$item
[
'completion_rate'
]
=
intval
(
$item
[
'completion_rate'
])
??
0
;
}
}
...
...
app/model/CertFile.php
0 → 100644
View file @
4fc5c753
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\model
;
use
app\model\project\User
;
use
app\model\system\SystemUploadFile
;
use
think\Model
;
/**
* 课程模型
*/
class
CertFile
extends
Model
{
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
public
function
certdata
()
{
return
$this
->
hasOne
(
Cert
::
class
,
'id'
,
'cert_id'
)
->
field
(
'id,title,price'
);
}
public
function
userprofile
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
)
->
field
(
'id,username,mobile'
);
}
public
function
certfile
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'file_id'
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype,storage'
);
}
}
\ No newline at end of file
app/model/CertOrder.php
View file @
4fc5c753
...
...
@@ -26,6 +26,14 @@ class CertOrder extends Model
}
public
function
certfiledata
()
{
return
$this
->
hasOne
(
CertFile
::
class
,
'cert_order_id'
,
'id'
)
->
field
(
'id,file_id,cert_order_id'
);
}
public
function
userprofile
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
)
...
...
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