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
8fe739f6
Commit
8fe739f6
authored
May 22, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务板块api接口
parent
118cf262
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1270 additions
and
23 deletions
+1270
-23
Withdrawal.php
app/admin/controller/caiwu/Withdrawal.php
+124
-0
Cert.php
app/admin/controller/cert/Cert.php
+9
-2
CertTag.php
app/admin/controller/cert/CertTag.php
+119
-0
Project.php
app/admin/controller/project/Project.php
+1
-1
CertTagValidate.php
app/admin/validate/CertTagValidate.php
+23
-0
index.html
app/admin/view/caiwu/withdrawal/index.html
+293
-0
edit.html
app/admin/view/cert/cert/edit.html
+54
-3
edit.html
app/admin/view/cert/cert_tag/edit.html
+49
-0
index.html
app/admin/view/cert/cert_tag/index.html
+184
-0
detail.html
app/admin/view/project/project/detail.html
+36
-1
Article.php
app/api/controller/Article.php
+51
-0
Student.php
app/api/controller/manage/Student.php
+69
-4
User.php
app/api/controller/manage/User.php
+46
-0
ArticleValidate.php
app/api/validate/ArticleValidate.php
+23
-0
BusinessValidate.php
app/api/validate/BusinessValidate.php
+15
-10
common.php
app/common.php
+36
-0
PhpOffice.php
app/event/PhpOffice.php
+70
-1
CertTag.php
app/model/CertTag.php
+3
-0
Business.php
app/model/project/Business.php
+18
-0
UserWithdrawal.php
app/model/project/UserWithdrawal.php
+47
-1
No files found.
app/admin/controller/caiwu/Withdrawal.php
0 → 100644
View file @
8fe739f6
<?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\UserWithdrawal
;
/**
* 后台主控制器
*/
class
Withdrawal
extends
AdminBase
{
protected
$withdrawal
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
withdrawal
=
new
UserWithdrawal
();
}
// 列表
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
[]
=
[
'title'
,
'like'
,
'%'
.
$post
[
'kw'
]
.
'%'
];
}
if
(
isset
(
$post
[
'cate_id'
])
&&
!
empty
(
$post
[
'cate_id'
]))
{
$map
[]
=
[
'cate_id'
,
'='
,
$post
[
'cate_id'
]];
}
$list
=
$this
->
withdrawal
->
where
(
$map
)
->
with
([
'getuserdata'
])
->
append
([
'sh_status_text'
,
'dk_status_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
->
withdrawal
->
destroy
([
$ids
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
//审核
public
function
shenhewithdrawal
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
2
;
if
(
$post
[
'shstatus'
]
==
1
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
1
;
}
$updatedata
[
'sh_status'
]
=
$shstatus
;
$updatedata
[
'sh_status_desc'
]
=
$errordesc
;
$result
=
$this
->
withdrawal
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
}
}
//打款
public
function
dakuanwithdrawal
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
3
;
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
}
$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
)
{
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
}
}
}
\ No newline at end of file
app/admin/controller/cert/Cert.php
View file @
8fe739f6
...
...
@@ -16,6 +16,7 @@ use app\model\Cert as CertModel;
use
think\App
;
use
think\facade\Db
;
use
app\model\CertCategory
;
use
app\model\CertTag
;
/**
* 后台主控制器
...
...
@@ -113,12 +114,18 @@ class Cert extends AdminBase
return
$this
->
returnMsg
(
$msg
,
1
);
}
$data
=
$this
->
cert
->
append
([
'starttimetxt'
,
'endtimetxt'
])
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$catemodel
=
new
CertCategory
();
$categorydata
=
$catemodel
->
catetree
(
isset
(
$data
[
'cate_id'
])
?
$data
[
'cate_id'
]
:
0
);
$certtaglist
=
CertTag
::
where
(
'is_del'
,
0
)
->
select
()
->
toArray
();
foreach
(
$certtaglist
as
&
$v
)
{
$v
[
'label'
]
=
$v
[
'title'
];
$v
[
'value'
]
=
$v
[
'id'
];
$v
[
'children'
]
=
[];
}
$this
->
assign
(
'categorydata'
,
$categorydata
);
$this
->
assign
(
'certtaglist'
,
json_encode
(
$certtaglist
));
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
...
...
app/admin/controller/cert/CertTag.php
0 → 100644
View file @
8fe739f6
<?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\admin\validate\CertTagValidate
;
use
app\model\CertTag
as
CertTagModel
;
use
think\App
;
use
think\facade\Db
;
/**
* 后台主控制器
*/
class
CertTag
extends
AdminBase
{
protected
$certtag
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
certtag
=
new
CertTagModel
();
}
// 列表
public
function
index
(
string
$do
=
''
)
{
$limit
=
10
;
if
(
$do
==
'json'
)
{
$post
=
input
();
$post
[
'limit'
]
=
isset
(
$post
[
'limit'
])
?
$post
[
'limit'
]
:
$limit
;
$map
[]
=
[
'is_del'
,
'='
,
0
];
if
(
isset
(
$post
[
'kw'
])
&&
!
empty
(
$post
[
'kw'
]))
{
$map
[]
=
[
'title'
,
'like'
,
'%'
.
$post
[
'kw'
]
.
'%'
];
}
$list
=
$this
->
certtag
->
where
(
$map
)
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$this
->
assign
(
'limit'
,
$limit
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//快速编辑
public
function
editup
()
{
$post
=
input
();
$result
=
$this
->
certtag
->
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
->
certtag
->
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
CertTagValidate
())
->
goCheck
();
if
(
$check
!==
true
)
{
return
$check
;
}
try
{
if
(
$post
[
'id'
]
>
0
)
{
$msg
=
'更新成功'
;
$this
->
certtag
->
update
(
$post
,
[
'id'
=>
$post
[
'id'
]]);
}
else
{
$post
[
'createtime'
]
=
time
();
unset
(
$post
[
'id'
]);
$msg
=
'添加成功'
;
$this
->
certtag
->
save
(
$post
);
}
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
(),
0
);
}
return
$this
->
returnMsg
(
$msg
,
1
);
}
$data
=
$this
->
certtag
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/controller/project/Project.php
View file @
8fe739f6
...
...
@@ -96,7 +96,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'
]);
$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
);
}
...
...
app/admin/validate/CertTagValidate.php
0 → 100644
View file @
8fe739f6
<?php
namespace
app\admin\validate
;
use
think\Validate
;
use
app\model
;
use
app\api\validate\BaseValidate
;
class
CertTagValidate
extends
BaseValidate
{
protected
$rule
=
[
'title'
=>
'require'
,
];
protected
$message
=
[
'title.require'
=>
'标签名称不能为空'
,
];
}
\ No newline at end of file
app/admin/view/caiwu/withdrawal/index.html
0 → 100644
View file @
8fe739f6
This diff is collapsed.
Click to expand it.
app/admin/view/cert/cert/edit.html
View file @
8fe739f6
{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 10px"
>
<form
class=
"layui-form "
style=
"margin-top: 20px;"
id=
"fjfrom"
>
...
...
@@ -42,6 +52,23 @@
value=
"{$data.price|default=''}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
证书标签
</label>
<div
class=
"layui-input-block"
id=
"vueapp"
>
<el-cascader
@
change=
"handleChange"
@
visible-change=
"removeqita"
v-model=
"selectedValue"
:options=
"options"
:props=
"{ multiple: true, checkStrictly: true,emitPath:false }"
clearable
></el-cascader>
<input
type=
"hidden"
name=
"tag_ids"
id=
"moretag_ids"
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
时间
</label>
<div
class=
"layui-input-inline"
>
...
...
@@ -80,12 +107,14 @@
<input
type=
"hidden"
name=
"id"
value=
"{$data.id|default=0}"
>
</form>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'buildItems'
,
'form'
,
'laydate'
,
'util'
],
function
()
{
layui
.
use
([
'
tagsInput'
,
'
buildItems'
,
'form'
,
'laydate'
,
'util'
],
function
()
{
var
form
=
layui
.
form
;
var
inputTags
=
layui
.
tagsInput
;
var
laydate
=
layui
.
laydate
;
// 渲染
laydate
.
render
({
...
...
@@ -110,7 +139,6 @@
gid
:
1
,
data
:
str
});
var
str
=
[{
"name"
:
"content"
,
"title"
:
"文章内容"
,
...
...
@@ -130,6 +158,7 @@
layui
.
buildItems
.
init
();
form
.
render
();
$
(
"#inputTags"
).
tagsInput
();
});
...
...
@@ -138,5 +167,27 @@
return
data
;
};
new
Vue
({
el
:
'#vueapp'
,
data
:
function
()
{
return
{
props
:
{
multiple
:
true
},
selectedValue
:[{
$data
.
tag_ids
|
default
=
''
}],
options
:{:
$certtaglist
}
}
},
methods
:
{
handleChange
(
value
)
{
console
.
log
(
value
);
$
(
'#moretag_ids'
).
val
(
value
);
},
removeqita
(){
$
(
'.el-cascader__dropdown .layui-form-checkbox'
).
remove
();
},
}
})
</script>
{/block}
\ No newline at end of file
app/admin/view/cert/cert_tag/edit.html
0 → 100644
View file @
8fe739f6
{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 10px"
>
<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"
name=
"title"
placeholder=
"标签名称"
autocomplete=
"off"
class=
"layui-input"
value=
"{$data.title|default=''}"
>
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
"{$data.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
;
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/admin/view/cert/cert_tag/index.html
0 → 100644
View file @
8fe739f6
<div
class=
"layui-fluid"
>
<style>
#certtagcategoryTreeBar
{
padding
:
10px
15px
;
border
:
1px
solid
#e6e6e6
;
background-color
:
#f2f2f2
}
#certtagcategoryTree
{
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_itemwcerttag
{
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_itemwcerttag
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=
"certtag-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"
>
<div
class=
"layui-btn-group"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"search-certtag"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-certtag-all"
onclick=
"$('#certtag-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
<a
class=
"layui-btn"
id=
"certtag-add"
><i
class=
"layui-icon layui-icon-add-circle"
></i>
添加
</a>
<a
class=
"layui-btn"
id=
"certtag-del"
><i
class=
"layui-icon layui-icon-delete"
></i>
删除
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"certtag"
id=
"certtag"
></table>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"certtagDemo"
>
<
div
class
=
"layui-clear-space"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"edit"
>
编辑
<
/a
>
<
a
class
=
"layui-btn layui-btn-xs layui-btn-danger"
lay
-
event
=
"del"
>
删除
<
/a
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"status-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'
,
'dropdown'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'cert.cert_tag/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table
.
render
({
elem
:
'#certtag'
,
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
:
'title'
,
align
:
'center'
,
title
:
'标签名称'
,
edit
:
'text'
},
{
field
:
'createtime'
,
width
:
160
,
align
:
'center'
,
title
:
'发布时间'
},
{
fixed
:
'right'
,
width
:
150
,
align
:
'center'
,
templet
:
'#certtagDemo'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="certtag"]'
));
}
});
// 状态 - 开关操作
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(certtag)'
,
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(certtag)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'edit'
){
certtagOpen
(
data
.
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'certtag-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
(
'certtag'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*顶部删除按钮*/
$
(
'#certtag-del'
).
on
(
'click'
,
function
(){
var
checkRows
=
table
.
checkStatus
(
'certtag'
).
data
;
if
(
checkRows
.
length
===
0
){
return
layer
.
msg
(
'请选择需删除的记录'
);}
var
ids
=
checkRows
.
map
(
function
(
d
){
return
d
.
id
;});
console
.
log
(
ids
);
del
(
ids
);
});
/**/
$
(
'#certtag-add'
).
on
(
'click'
,
function
(){
certtagOpen
();});
/**/
/*弹出窗*/
function
certtagOpen
(
id
=
''
,
type
=
''
){
var
title
=
"添加标签"
;
if
(
id
>
0
){
title
=
'编辑标签'
;
}
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'850px'
],
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
fixed
:
false
,
//不固定
content
:
app_root
+
'/edit?id='
+
id
+
'&type='
+
type
,
yes
:
function
(
index
,
layero
){
var
data
=
window
[
"layui-layer-iframe"
+
index
].
callbackdata
();
$
.
ajax
({
method
:
"post"
,
url
:
app_root
+
'/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
(
'certtag'
);
});
}
else
{
layer
.
msg
(
res
.
msg
,{
icon
:
2
,
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
});
}
// layer.closeAll();
}
});
},
});
}
/**/
});
</script>
\ No newline at end of file
app/admin/view/project/project/detail.html
View file @
8fe739f6
...
...
@@ -20,7 +20,7 @@
</tr>
<tr>
<td
class=
"widthtd"
><strong>
项目标签
</strong></td>
<td>
{$info.tag
str
}
</td>
<td>
{$info.tag
_title
}
</td>
<td
class=
"widthtd"
><strong>
预算
</strong></td>
<td>
{$info.yusuan}
</td>
</tr>
...
...
@@ -54,6 +54,41 @@
<td
class=
"widthtd"
><strong>
项目简介
</strong></td>
<td
colspan=
"4"
>
{$info.description}
</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.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/course.course_work/downloadfile?fileid={$data.fileid}"
target=
"_blank"
>
下载
</a>
{/in}
</td>
</tr>
{/volist}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
...
...
app/api/controller/Article.php
0 → 100644
View file @
8fe739f6
<?php
namespace
app\api\controller
;
use
think\Request
;
use
app\api\validate\ArticleValidate
;
use
app\BaseController
;
use
app\model\ArticleModel
;
class
Article
extends
BaseController
{
//文章列表
public
function
getArticleList
(
Request
$request
)
{
$vo
=
(
new
ArticleValidate
())
->
goCheck
([
'cate_id'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$where
=
[
'cate_id'
=>
$parm
[
'cate_id'
],
'is_del'
=>
0
];
$page
=
$request
->
param
(
'page'
,
1
);
$pageSize
=
$request
->
param
(
'pageSize'
,
10
);
$list
=
ArticleModel
::
where
(
$where
)
->
field
(
'id,title,description,sort,click,createtime,thumb,cate_id'
)
->
order
(
'createtime desc'
)
->
append
([
'thumbpath'
])
->
paginate
([
'page'
=>
$page
,
'list_rows'
=>
$pageSize
]);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
//文章详情
public
function
getArticleDetail
(
Request
$request
){
$vo
=
(
new
ArticleValidate
())
->
goCheck
([
'article_id'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$info
=
ArticleModel
::
find
(
$parm
[
'article_id'
])
->
append
([
'thumbpath'
]);
ArticleModel
::
where
(
'id'
,
$parm
[
'article_id'
])
->
inc
(
'click'
)
->
update
([]);
return
$this
->
returnMsg
(
'success'
,
1
,
$info
);
}
}
\ No newline at end of file
app/api/controller/manage/Student.php
View file @
8fe739f6
...
...
@@ -23,7 +23,7 @@ class Student extends BaseController
//添加学生
public
function
createStudent
(
Request
$request
)
{
$vo
=
(
new
StudentValidate
())
->
goCheck
([
'realname'
,
'sex'
,
'age'
,
'
birthday'
,
'
idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
]);
$vo
=
(
new
StudentValidate
())
->
goCheck
([
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
...
...
@@ -138,14 +138,16 @@ class Student extends BaseController
}
//导入学生
public
function
StudentExcel
(
Request
$request
)
public
function
StudentExcel
11
(
Request
$request
)
{
set_time_limit
(
0
);
// 无时间限制
ini_set
(
'memory_limit'
,
'512M'
);
$vo
=
(
new
StudentValidate
())
->
goCheck
([
'file_id'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'
birthday'
,
'
idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
try
{
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
$filePath
=
$fileinfo
[
'fileurl'
];
...
...
@@ -194,4 +196,67 @@ class Student extends BaseController
}
}
//导入学生
public
function
StudentExcel
(
Request
$request
)
{
set_time_limit
(
0
);
// 无时间限制
ini_set
(
'memory_limit'
,
'512M'
);
$vo
=
(
new
StudentValidate
())
->
goCheck
([
'file_id'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
try
{
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
$filePath
=
$fileinfo
[
'fileurl'
];
$filepath
=
'.'
.
strstr
(
$filePath
,
'/static/'
);
if
(
!
file_exists
(
$filepath
))
{
throw
new
\Exception
(
"文件不存在: "
.
$filepath
);
}
$school_user_id
=
\request
()
->
userId
;
PhpOffice
::
chunkedImportXlsx
(
$filepath
,
function
(
$list
,
$startRow
,
$endRow
)
use
(
$checkfiled
,
$school_user_id
)
{
// echo "处理行 {$startRow} 到 {$endRow}" . PHP_EOL;
$datalin
=
[];
foreach
(
$list
[
0
]
as
$k
=>
$item
)
{
$thisitem
=
trim
(
$item
);
$datalin
=
StudentModel
::
excelfiled
(
$thisitem
,
$k
,
$datalin
);
}
unset
(
$list
[
0
]);
$createdata
=
[];
$sv
=
new
StudentValidate
();
foreach
(
$list
as
$vo
)
{
$savedata
=
array
();
foreach
(
$datalin
as
$ks
=>
$linval
)
{
if
(
$ks
==
'birthday'
)
{
$savedata
[
$ks
]
=
strtotime
(
trim
(
$vo
[
$linval
]));
}
else
{
$savedata
[
$ks
]
=
trim
(
$vo
[
$linval
]);
}
}
//验证数据
$vo
=
$sv
->
goCheck
(
$checkfiled
,
$savedata
);
if
(
$vo
!==
true
)
{
throw
new
\Exception
(
$sv
->
getError
());
}
$user_id
=
$this
->
createuser
(
$savedata
);
$savedata
[
'school_user_id'
]
=
$school_user_id
;
$savedata
[
'user_id'
]
=
$user_id
;
$createdata
[]
=
$savedata
;
}
StudentModel
::
saveAll
(
$createdata
);
});
return
$this
->
returnMsg
(
'导入成功'
,
1
);
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
());
}
}
}
\ No newline at end of file
app/api/controller/manage/User.php
0 → 100644
View file @
8fe739f6
<?php
namespace
app\api\controller\manage
;
use
app\api\middleware\Auth
;
use
app\api\service\UtilService
;
use
app\api\validate\BusinessValidate
;
use
app\BaseController
;
use
app\Request
;
use
think\facade\Db
;
use
app\model\project\User
as
UserModel
;
use
app\model\project\Business
;
class
User
extends
BaseController
{
protected
$middleware
=
[
Auth
::
class
,
];
//获取企业信息
public
function
getBusinessInfo
(
Request
$request
)
{
$info
=
Business
::
where
([
'user_id'
=>
$request
->
userId
,
'is_del'
=>
'0'
])
->
with
([
'businessQualification'
,
'businessfrsfzqian'
,
'businessfrsfzhou'
])
->
find
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$info
);
}
//修改企业信息
public
function
editBusinessInfo
(
Request
$request
)
{
$vo
=
(
new
BusinessValidate
())
->
goCheck
([
'frxm'
,
'qydm'
,
'frsfz'
,
'business_qualification_url_id'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$param
=
$request
->
param
();
$result
=
Business
::
where
([
'user_id'
=>
$request
->
userId
,
'is_del'
=>
'0'
])
->
update
(
$param
);
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$result
);
}
}
\ No newline at end of file
app/api/validate/ArticleValidate.php
0 → 100644
View file @
8fe739f6
<?php
namespace
app\api\validate
;
use
think\Validate
;
class
ArticleValidate
extends
BaseValidate
{
protected
$rule
=
[
'cate_id'
=>
'require'
,
'article_id'
=>
'require'
,
];
protected
$message
=
[
'cate_id.require'
=>
'分类id不能为空'
,
'article_id.require'
=>
'文章id不能为空'
,
];
}
\ No newline at end of file
app/api/validate/BusinessValidate.php
View file @
8fe739f6
...
...
@@ -25,16 +25,21 @@ class BusinessValidate extends BaseValidate
'business_project_url_id'
=>
'require'
,
'business_logo_url_id'
=>
'require'
,
'more_url_id'
=>
'require'
,
'frxm'
=>
'require'
,
'qymc'
=>
'require'
,
'qydz'
=>
'require'
,
'qydm'
=>
'require'
,
'frsfz'
=>
'idCard'
,
];
// protected $message = [
// 'name.require' => '名称必须',
// 'mobile.require' => '手机号不能为空',
// 'mobile.mobile' => '手机号格式不正确',
// 'password.require' => '密码必须',
// 'code.require' => '验证码必须',
// 'token.require' => 'token必须',
// 'str.require' => '必填项不能为空',
// 'confirm_password.checkPasswordEqual' => '两次输入的密码不一致'
// ];
protected
$message
=
[
'frxm.require'
=>
'法人姓名不能为空'
,
'qymc.require'
=>
'企业名称不能为空'
,
'qydm.require'
=>
'机构代码不能为空'
,
'qydz.require'
=>
'企业地址不能为空'
,
'frsfz.idCard'
=>
'法人身份证格式错误'
,
];
}
\ No newline at end of file
app/common.php
View file @
8fe739f6
...
...
@@ -539,6 +539,42 @@ function list_tree($rs = [], $pid = 0, $key = ['id', 'parentid', 'title'], $t =
return
$arr
;
}
/**
* 把返回的数据集转换成Tree
* @param array $list 要转换的数据集
* @param string $pid parent标记字段
* @param string $level level标记字段
* @return array
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
function
list_to_tree
(
$list
,
$pk
=
'id'
,
$pid
=
'pid'
,
$child
=
'_child'
,
$root
=
0
)
{
// 创建Tree
$tree
=
array
();
if
(
is_array
(
$list
))
{
// 创建基于主键的数组引用
$refer
=
array
();
foreach
(
$list
as
$key
=>
$data
)
{
$refer
[
$data
[
$pk
]]
=&
$list
[
$key
];
$list
[
$key
][
$child
]
=
[];
}
foreach
(
$list
as
$key
=>
$data
)
{
// 判断是否存在parent
$parentId
=
$data
[
$pid
];
if
(
$root
==
$parentId
)
{
$tree
[]
=&
$list
[
$key
];
}
else
{
if
(
isset
(
$refer
[
$parentId
]))
{
$parent
=&
$refer
[
$parentId
];
$parent
[
$child
][]
=&
$list
[
$key
];
}
}
}
}
return
$tree
;
}
/**
* 生成单据号
* @param string $code 单据标识
...
...
app/event/PhpOffice.php
View file @
8fe739f6
...
...
@@ -17,7 +17,11 @@ use PhpOffice\PhpSpreadsheet\IOFactory;
*/
class
PhpOffice
{
/****
* 普通导入
* @param $filePath
* @return array
*/
public
static
function
importexcel
(
$filePath
)
{
...
...
@@ -49,4 +53,69 @@ class PhpOffice
// return $data;
}
/****
* 分块导入适合大数据
* @param $filePath
* @param $callback
* @param $chunkSize
* @return void
*/
public
static
function
chunkedImportXlsx
(
$filePath
,
$callback
,
$chunkSize
=
1000
)
{
// 创建适当的读取器 (自动检测文件类型)
$reader
=
IOFactory
::
createReaderForFile
(
$filePath
);
// 只读取数据,不读取样式信息 (提高性能)
$reader
->
setReadDataOnly
(
true
);
// 获取工作表信息 (特别是总行数)
$worksheetInfo
=
$reader
->
listWorksheetInfo
(
$filePath
);
$totalRows
=
$worksheetInfo
[
0
][
'totalRows'
];
// 计算需要读取的块数
$chunkCount
=
ceil
(
$totalRows
/
$chunkSize
);
// 分块读取
for
(
$i
=
0
;
$i
<
$chunkCount
;
$i
++
)
{
$startRow
=
(
$i
*
$chunkSize
)
+
1
;
// +1 因为Excel行从1开始
$endRow
=
min
(((
$i
+
1
)
*
$chunkSize
),
$totalRows
);
// // 设置读取过滤器
$chunkFilter
=
new
ChunkReadFilter
(
$startRow
,
$endRow
);
$reader
->
setReadFilter
(
$chunkFilter
);
// 加载当前块的数据
$spreadsheet
=
$reader
->
load
(
$filePath
);
$sheet
=
$spreadsheet
->
getActiveSheet
();
// 将数据转换为数组
$data
=
$sheet
->
toArray
();
// 处理数据 (通过回调函数)
$callback
(
$data
,
$startRow
,
$endRow
);
// 重要!清理内存
$spreadsheet
->
disconnectWorksheets
();
unset
(
$spreadsheet
,
$sheet
,
$data
);
}
}
}
class
ChunkReadFilter
implements
\PhpOffice\PhpSpreadsheet\Reader\IReadFilter
{
private
$startRow
=
0
;
private
$endRow
=
0
;
public
function
__construct
(
$startRow
,
$endRow
)
{
$this
->
startRow
=
$startRow
;
$this
->
endRow
=
$endRow
;
}
public
function
readCell
(
$column
,
$row
,
$worksheetName
=
''
)
:
bool
{
// 只读取指定行范围内的单元格
return
(
$row
>=
$this
->
startRow
&&
$row
<=
$this
->
endRow
);
}
}
\ No newline at end of file
app/model/CertTag.php
View file @
8fe739f6
...
...
@@ -7,4 +7,7 @@ use think\Model;
class
CertTag
extends
Model
{
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
}
\ No newline at end of file
app/model/project/Business.php
View file @
8fe739f6
...
...
@@ -53,6 +53,24 @@ class Business extends Model
->
field
(
'fileid,filename,filesize,fileurl,filetype,fileext'
);
}
//法人身份证正面
public
function
businessfrsfzqian
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'frsfz_qian'
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype,fileext'
);
}
//法人身份证反面
public
function
businessfrsfzhou
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'frsfz_hou'
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype,fileext'
);
}
//用户信息
public
function
getuserdata
()
{
...
...
app/model/project/UserWithdrawal.php
View file @
8fe739f6
...
...
@@ -5,6 +5,7 @@ namespace app\model\project;
use
app\api\service\UtilService
;
use
app\model\project\User
as
UserModel
;
use
think\Model
;
use
think\model\concern\SoftDelete
;
class
UserWithdrawal
extends
Model
{
...
...
@@ -16,6 +17,9 @@ class UserWithdrawal extends Model
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
false
;
use
SoftDelete
;
protected
$deleteTime
=
'deletetime'
;
// 提现状态常量
const
SH_STATUS_PENDING
=
0
;
// 待审核
const
SH_STATUS_FAILED
=
1
;
// 审核失败
...
...
@@ -83,7 +87,7 @@ class UserWithdrawal extends Model
// 提交事务
$this
->
commit
();
//
UserMoneyLog::addUserMoneyLog($userId,$amount,$front_money,1,'用户提现',$withdrawalId);
UserMoneyLog
::
addUserMoneyLog
(
$userId
,
$amount
,
$front_money
,
1
,
'用户提现'
,
$withdrawalId
);
return
[
'status'
=>
true
,
...
...
@@ -102,4 +106,46 @@ class UserWithdrawal extends Model
}
}
//用户信息
public
function
getuserdata
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
)
->
field
(
'username,mobile,id'
);
}
public
function
getShStatusTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'sh_status'
])
{
case
self
::
SH_STATUS_FAILED
:
$statustxt
=
'审核失败'
;
break
;
case
self
::
SH_STATUS_SUCCESS
:
$statustxt
=
'审核成功'
;
break
;
default
:
$statustxt
=
'待审核'
;
}
return
$statustxt
;
}
public
function
getDkStatusTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'dk_status'
])
{
case
self
::
DK_STATUS_PROCESSING
:
$statustxt
=
'打款中'
;
break
;
case
self
::
DK_STATUS_FAILED
:
$statustxt
=
'打款失败'
;
break
;
case
self
::
DK_STATUS_PAID
:
$statustxt
=
'已打款'
;
break
;
default
:
$statustxt
=
'等待审核'
;
}
return
$statustxt
;
}
}
\ No newline at end of file
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