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
b151f173
Commit
b151f173
authored
Jun 18, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理后台 看板
parent
37fb1f8d
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
750 additions
and
63 deletions
+750
-63
CourseTag.php
app/admin/controller/course/CourseTag.php
+119
-0
ProjectTag.php
app/admin/controller/project/ProjectTag.php
+116
-0
Business.php
app/admin/controller/users/Business.php
+3
-2
School.php
app/admin/controller/users/School.php
+2
-3
ArticleValidate.php
app/admin/validate/ArticleValidate.php
+3
-3
index.html
app/admin/view/advert_cate/index.html
+1
-1
index.html
app/admin/view/article_category/index.html
+1
-1
edit.html
app/admin/view/course/course_tag/edit.html
+49
-0
index.html
app/admin/view/course/course_tag/index.html
+173
-0
edit.html
app/admin/view/project/project_tag/edit.html
+49
-0
index.html
app/admin/view/project/project_tag/index.html
+172
-0
detail.html
app/admin/view/users/business/detail.html
+26
-24
detail.html
app/admin/view/users/school/detail.html
+20
-20
CourseTeacher.php
app/api/controller/manage/CourseTeacher.php
+1
-1
ShCourse.php
app/api/controller/manage/ShCourse.php
+2
-2
Student.php
app/api/controller/manage/Student.php
+8
-5
CourseTeacherValidate.php
app/api/validate/CourseTeacherValidate.php
+2
-0
ShCourseValidate.php
app/api/validate/ShCourseValidate.php
+3
-1
No files found.
app/admin/controller/course/CourseTag.php
0 → 100644
View file @
b151f173
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\course
;
use
app\admin\controller\AdminBase
;
use
app\admin\validate\CertTagValidate
;
use
app\model\CourseTag
as
CourseTagModel
;
use
think\App
;
use
think\facade\Db
;
/**
* 后台主控制器
*/
class
CourseTag
extends
AdminBase
{
protected
$coursetag
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
coursetag
=
new
CourseTagModel
();
}
// 列表
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
->
coursetag
->
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
->
coursetag
->
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
->
coursetag
->
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
->
coursetag
->
update
(
$post
,
[
'id'
=>
$post
[
'id'
]]);
}
else
{
$post
[
'createtime'
]
=
time
();
unset
(
$post
[
'id'
]);
$msg
=
'添加成功'
;
$this
->
coursetag
->
save
(
$post
);
}
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
(),
0
);
}
return
$this
->
returnMsg
(
$msg
,
1
);
}
$data
=
$this
->
coursetag
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/controller/project/ProjectTag.php
0 → 100644
View file @
b151f173
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\project
;
use
app\admin\controller\AdminBase
;
use
app\admin\validate\CertTagValidate
;
use
app\model\ProjectTag
as
ProjectTagModel
;
use
think\App
;
use
think\facade\Db
;
/**
* 后台主控制器
*/
class
ProjectTag
extends
AdminBase
{
protected
$projecttag
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
projecttag
=
new
ProjectTagModel
();
}
// 列表
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
->
projecttag
->
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
->
projecttag
->
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
->
projecttag
->
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
->
projecttag
->
update
(
$post
,
[
'id'
=>
$post
[
'id'
]]);
}
else
{
$post
[
'createtime'
]
=
time
();
unset
(
$post
[
'id'
]);
$msg
=
'添加成功'
;
$this
->
projecttag
->
save
(
$post
);
}
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
(),
0
);
}
return
$this
->
returnMsg
(
$msg
,
1
);
}
$data
=
$this
->
projecttag
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/controller/users/Business.php
View file @
b151f173
...
@@ -60,9 +60,10 @@ class Business extends AdminBase
...
@@ -60,9 +60,10 @@ class Business extends AdminBase
//详情
//详情
public
function
detail
()
public
function
detail
()
{
{
// ->append(['business_qualification_list', 'business_industry_list', 'business_project_list', 'business_More_list'])
$post
=
input
();
$post
=
input
();
$info
=
$this
->
business
->
with
([
'businessQualification'
,
'businessIndustry'
,
'businessPorject'
,
'businessMore'
,
'businessLogo'
])
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
// $info = $this->business->with(['businessQualification', 'businessIndustry', 'businessPorject', 'businessMore', 'businessLogo'])->where('id', $post['id'])->find()->toArray
();
$info
=
$this
->
business
->
with
([
'businessLogo'
])
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
return
$this
->
fetch
(
''
,
''
,
false
);
...
...
app/admin/controller/users/School.php
View file @
b151f173
...
@@ -62,10 +62,9 @@ class School extends AdminBase
...
@@ -62,10 +62,9 @@ class School extends AdminBase
public
function
detail
()
public
function
detail
()
{
{
$post
=
input
();
$post
=
input
();
$info
=
$this
->
school
->
with
([
'schoolQualification'
,
'teacherQualification'
,
'agreement'
,
'moreFile'
])
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
//
$info = $this->school->with(['schoolQualification','teacherQualification','agreement','moreFile'])->where('id', $post['id'])->find();
$info
=
$this
->
school
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
...
...
app/admin/validate/ArticleValidate.php
View file @
b151f173
...
@@ -12,13 +12,13 @@ class ArticleValidate extends BaseValidate
...
@@ -12,13 +12,13 @@ class ArticleValidate extends BaseValidate
protected
$rule
=
[
protected
$rule
=
[
'title'
=>
'require'
,
'title'
=>
'require'
,
'cate_id'
=>
'require|checkarticle'
,
'cate_id'
=>
'require|checkarticle'
,
'thumb'
=>
'require'
,
//
'thumb' => 'require',
];
];
protected
$message
=
[
protected
$message
=
[
'title.require'
=>
'文章标题不能为空'
,
'title.require'
=>
'文章标题不能为空'
,
'cate_id.require'
=>
'请选择分类'
,
'cate_id.require'
=>
'请选择分类'
,
'cate_id.checkarticle'
=>
'此分类是单页只能添加一篇文章'
,
'cate_id.checkarticle'
=>
'此分类是单页只能添加一篇文章'
'thumb.require'
=>
'请上传图片'
,
//
'thumb.require' => '请上传图片',
];
];
...
...
app/admin/view/advert_cate/index.html
View file @
b151f173
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
}
}
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
area
:
[
'
6
00px'
,
'70%'
],
area
:
[
'
9
00px'
,
'70%'
],
title
:
title
,
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
btn
:
[
'确定'
,
'关闭'
],
// fixed: false, //不固定
// fixed: false, //不固定
...
...
app/admin/view/article_category/index.html
View file @
b151f173
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
}
}
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
area
:
[
'
7
00px'
,
'90%'
],
area
:
[
'
9
00px'
,
'90%'
],
title
:
title
,
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
btn
:
[
'确定'
,
'关闭'
],
// fixed: false, //不固定
// fixed: false, //不固定
...
...
app/admin/view/course/course_tag/edit.html
0 → 100644
View file @
b151f173
{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"
>
<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/course/course_tag/index.html
0 → 100644
View file @
b151f173
<div
class=
"layui-fluid"
>
<style>
#coursetagcategoryTreeBar
{
padding
:
10px
15px
;
border
:
1px
solid
#e6e6e6
;
background-color
:
#f2f2f2
}
#coursetagcategoryTree
{
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_itemwcoursetag
{
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_itemwcoursetag
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=
"coursetag-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-coursetag"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-coursetag-all"
onclick=
"$('#coursetag-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
<a
class=
"layui-btn"
id=
"coursetag-add"
><i
class=
"layui-icon layui-icon-add-circle"
></i>
添加
</a>
<a
class=
"layui-btn"
id=
"coursetag-del"
><i
class=
"layui-icon layui-icon-delete"
></i>
删除
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"coursetag"
id=
"coursetag"
></table>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"coursetagDemo"
>
<
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>
<!--JS部分-->
<script>
layui
.
use
([
'vinfo'
,
'buildItems'
,
'dropdown'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'course.course_tag/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table
.
render
({
elem
:
'#coursetag'
,
page
:
true
,
limit
:{
$limit
},
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
:
'#coursetagDemo'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="coursetag"]'
));
}
});
// 状态 - 开关操作
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(coursetag)'
,
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(coursetag)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'edit'
){
coursetagOpen
(
data
.
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'coursetag-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
(
'coursetag'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*顶部删除按钮*/
$
(
'#coursetag-del'
).
on
(
'click'
,
function
(){
var
checkRows
=
table
.
checkStatus
(
'coursetag'
).
data
;
if
(
checkRows
.
length
===
0
){
return
layer
.
msg
(
'请选择需删除的记录'
);}
var
ids
=
checkRows
.
map
(
function
(
d
){
return
d
.
id
;});
console
.
log
(
ids
);
del
(
ids
);
});
/**/
$
(
'#coursetag-add'
).
on
(
'click'
,
function
(){
coursetagOpen
();});
/**/
/*弹出窗*/
function
coursetagOpen
(
id
=
''
,
type
=
''
){
var
title
=
"添加标签"
;
if
(
id
>
0
){
title
=
'编辑标签'
;
}
layer
.
open
({
type
:
2
,
area
:
[
'600px'
,
'600px'
],
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
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
(
'coursetag'
);
});
}
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_tag/edit.html
0 → 100644
View file @
b151f173
{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"
>
<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/project/project_tag/index.html
0 → 100644
View file @
b151f173
<div
class=
"layui-fluid"
>
<style>
#projecttagcategoryTreeBar
{
padding
:
10px
15px
;
border
:
1px
solid
#e6e6e6
;
background-color
:
#f2f2f2
}
#projecttagcategoryTree
{
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_itemwprojecttag
{
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_itemwprojecttag
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=
"projecttag-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-projecttag"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-projecttag-all"
onclick=
"$('#projecttag-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
<a
class=
"layui-btn"
id=
"projecttag-add"
><i
class=
"layui-icon layui-icon-add-circle"
></i>
添加
</a>
<a
class=
"layui-btn"
id=
"projecttag-del"
><i
class=
"layui-icon layui-icon-delete"
></i>
删除
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"projecttag"
id=
"projecttag"
></table>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"projecttagDemo"
>
<
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>
<!--JS部分-->
<script>
layui
.
use
([
'vinfo'
,
'buildItems'
,
'dropdown'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'project.project_tag/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table
.
render
({
elem
:
'#projecttag'
,
page
:
true
,
limit
:{
$limit
},
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
:
'#projecttagDemo'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="projecttag"]'
));
}
});
// 状态 - 开关操作
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(projecttag)'
,
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(projecttag)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'edit'
){
projecttagOpen
(
data
.
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'projecttag-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
(
'projecttag'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*顶部删除按钮*/
$
(
'#projecttag-del'
).
on
(
'click'
,
function
(){
var
checkRows
=
table
.
checkStatus
(
'projecttag'
).
data
;
if
(
checkRows
.
length
===
0
){
return
layer
.
msg
(
'请选择需删除的记录'
);}
var
ids
=
checkRows
.
map
(
function
(
d
){
return
d
.
id
;});
console
.
log
(
ids
);
del
(
ids
);
});
/**/
$
(
'#projecttag-add'
).
on
(
'click'
,
function
(){
projecttagOpen
();});
/**/
/*弹出窗*/
function
projecttagOpen
(
id
=
''
,
type
=
''
){
var
title
=
"添加标签"
;
if
(
id
>
0
){
title
=
'编辑标签'
;
}
layer
.
open
({
type
:
2
,
area
:
[
'600px'
,
'600px'
],
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
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
(
'projecttag'
);
});
}
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/users/business/detail.html
View file @
b151f173
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<div
style=
"margin: 0px 10px;"
>
<div
style=
"margin: 0px 10px;"
>
<p
style=
"padding-top: 10px;"
>
学校
基本信息:
</p>
<p
style=
"padding-top: 10px;"
>
企业
基本信息:
</p>
<table
class=
"layui-table"
>
<table
class=
"layui-table"
>
<tbody>
<tbody>
<tr>
<tr>
...
@@ -60,39 +60,41 @@
...
@@ -60,39 +60,41 @@
<tr>
<tr>
<td
class=
"widthtd"
><strong>
企业资质证明
</strong></td>
<td
class=
"widthtd"
><strong>
企业资质证明
</strong></td>
<td>
<td>
{foreach $info.business_qualification_list as $key=>$vo }
{in name="info.businessQualification
.fileext" value="jpg,png,jpeg"}
{in name="vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$info.businessQualification
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.business/downloadfile?fileid={$info.businessQualification.fileid}"
target=
"_blank"
>
{$info.businessQualification
.filename}
</a>
<a
href=
"/admin/users.business/downloadfile?fileid={$vo.fileid}"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/foreach}
</td>
</td>
<td
class=
"widthtd"
><strong>
行业认证证书
</strong></td>
<td
class=
"widthtd"
><strong>
行业认证证书
</strong></td>
<td>
<td>
{
if $info.businessIndustry
}
{
foreach $info.business_industry_list as $key=>$vo
}
{in name="
info.businessIndustry
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.businessIndustry
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.business/downloadfile?fileid={$
info.businessIndustry.fileid}"
target=
"_blank"
>
{$info.businessIndustry
.filename}
</a>
<a
href=
"/admin/users.business/downloadfile?fileid={$
vo.fileid}"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"widthtd"
><strong>
项目案例展示
</strong></td>
<td
class=
"widthtd"
><strong>
项目案例展示
</strong></td>
<td>
<td>
{if $info.businessPorject}
{in name="info.businessPorject.fileext" value="jpg,png,jpeg"}
<img
src=
"{$info.businessPorject.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{foreach $info.business_project_list as $key=>$vo }
{in name="vo.fileext" value="jpg,png,jpeg"}
<img
src=
"{$vo.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.business/downloadfile?fileid={$
info.businessPorject.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$info.businessPorject
.filename}
</a>
<a
href=
"/admin/users.business/downloadfile?fileid={$
vo.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
<td
class=
"widthtd"
><strong>
企业logo
</strong></td>
<td
class=
"widthtd"
><strong>
企业logo
</strong></td>
<td>
<td>
{if $info.business
Porject
}
{if $info.business
Logo
}
{in name="info.businessLogo.fileext" value="jpg,png,jpeg"}
{in name="info.businessLogo.fileext" value="jpg,png,jpeg"}
<img
src=
"{$info.businessLogo.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$info.businessLogo.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
...
@@ -105,13 +107,13 @@
...
@@ -105,13 +107,13 @@
<tr>
<tr>
<td
class=
"widthtd"
><strong>
补充材料
</strong></td>
<td
class=
"widthtd"
><strong>
补充材料
</strong></td>
<td>
<td>
{
if $info.businessMore
}
{
foreach $info.business_More_list as $key=>$vo
}
{in name="
info.businessMore
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.businessMore
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.business/downloadfile?fileid={$
info.businessMore.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$info.businessMore
.filename}
</a>
<a
href=
"/admin/users.business/downloadfile?fileid={$
vo.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
</tr>
</tr>
...
...
app/admin/view/users/school/detail.html
View file @
b151f173
...
@@ -49,46 +49,46 @@
...
@@ -49,46 +49,46 @@
<td
class=
"widthtd"
><strong>
学校资质证明
</strong></td>
<td
class=
"widthtd"
><strong>
学校资质证明
</strong></td>
<td>
<td>
{
if $info.schoolQualification
}
{
foreach $info.school_qualification_list as $key=>$vo
}
{in name="
info.schoolQualification
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.schoolQualification
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.school/downloadfile?fileid={$
info.schoolQualification.fileid}"
target=
"_blank"
>
{$info.schoolQualification
.filename}
</a>
<a
href=
"/admin/users.school/downloadfile?fileid={$
vo.fileid}"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
<td
class=
"widthtd"
><strong>
合作协议
</strong></td>
<td
class=
"widthtd"
><strong>
合作协议
</strong></td>
<td>
<td>
{
if $info.agreement
}
{
foreach $info.agreement_list as $key=>$vo
}
{in name="
info.agreement
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.agreement
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.school/downloadfile?fileid={$
info.agreement.fileid}"
target=
"_blank"
>
{$info.agreement
.filename}
</a>
<a
href=
"/admin/users.school/downloadfile?fileid={$
vo.fileid}"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"widthtd"
><strong>
导师资质证明
</strong></td>
<td
class=
"widthtd"
><strong>
导师资质证明
</strong></td>
<td>
<td>
{
if $info.teacherQualification
}
{
foreach $info.teacher_qualification_list as $key=>$vo
}
{in name="
info.teacherQualification
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.teacherQualification
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.school/downloadfile?fileid={$
info.teacherQualification.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$info.teacherQualification
.filename}
</a>
<a
href=
"/admin/users.school/downloadfile?fileid={$
vo.fileid}"
class=
"layui-font-green"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
<td
class=
"widthtd"
><strong>
补充材料
</strong></td>
<td
class=
"widthtd"
><strong>
补充材料
</strong></td>
<td>
<td>
{
if $info.moreFile
}
{
foreach $info.more_file_list as $key=>$vo
}
{in name="
info.moreFile
.fileext" value="jpg,png,jpeg"}
{in name="
vo
.fileext" value="jpg,png,jpeg"}
<img
src=
"{$
info.moreFile
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
<img
src=
"{$
vo
.fileurl}"
width=
"100"
height=
"100"
class=
"imgclick"
>
{else/}
{else/}
<a
href=
"/admin/users.school/downloadfile?fileid={$
info.moreFile.fileid}"
target=
"_blank"
>
{$info.moreFile
.filename}
</a>
<a
href=
"/admin/users.school/downloadfile?fileid={$
vo.fileid}"
target=
"_blank"
>
{$vo
.filename}
</a>
{/in}
{/in}
{/
if
}
{/
foreach
}
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
...
app/api/controller/manage/CourseTeacher.php
View file @
b151f173
...
@@ -18,7 +18,7 @@ class CourseTeacher extends BaseController
...
@@ -18,7 +18,7 @@ class CourseTeacher extends BaseController
//添加讲师
//添加讲师
public
function
createCourseTeacher
(
Request
$request
)
public
function
createCourseTeacher
(
Request
$request
)
{
{
$vo
=
(
new
CourseTeacherValidate
())
->
goCheck
([
'nickname'
]);
$vo
=
(
new
CourseTeacherValidate
())
->
goCheck
([
'nickname'
,
'description'
]);
if
(
$vo
!==
true
)
{
if
(
$vo
!==
true
)
{
return
$vo
;
return
$vo
;
}
}
...
...
app/api/controller/manage/ShCourse.php
View file @
b151f173
...
@@ -119,7 +119,7 @@ class ShCourse extends BaseController
...
@@ -119,7 +119,7 @@ class ShCourse extends BaseController
//添加课程
//添加课程
public
function
createShCourse
(
Request
$request
)
public
function
createShCourse
(
Request
$request
)
{
{
$filed
=
[
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
];
$filed
=
[
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
];
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
if
(
$vo
!==
true
)
{
return
$vo
;
return
$vo
;
...
@@ -135,7 +135,7 @@ class ShCourse extends BaseController
...
@@ -135,7 +135,7 @@ class ShCourse extends BaseController
//修改课程
//修改课程
public
function
editShCourse
(
Request
$request
)
public
function
editShCourse
(
Request
$request
)
{
{
$filed
=
[
'course_id'
,
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
];
$filed
=
[
'course_id'
,
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
];
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
if
(
$vo
!==
true
)
{
return
$vo
;
return
$vo
;
...
...
app/api/controller/manage/Student.php
View file @
b151f173
...
@@ -149,7 +149,6 @@ class Student extends BaseController
...
@@ -149,7 +149,6 @@ class Student extends BaseController
return
$vo
;
return
$vo
;
}
}
$parm
=
$request
->
param
();
$parm
=
$request
->
param
();
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
try
{
try
{
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
...
@@ -215,19 +214,21 @@ class Student extends BaseController
...
@@ -215,19 +214,21 @@ class Student extends BaseController
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
$checkfiled
=
[
'realname'
,
'sex'
,
'age'
,
'idcard'
,
'mobile'
,
'xq'
,
'nj'
,
'bj'
,
'xh'
];
try
{
try
{
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
$fileinfo
=
get_upload_file
(
$parm
[
'file_id'
],
'info'
);
$file
P
ath
=
$fileinfo
[
'fileurl'
];
$file
p
ath
=
$fileinfo
[
'fileurl'
];
if
(
$fileinfo
[
'storage'
]
==
'aliyun'
)
{
if
(
$fileinfo
[
'storage'
]
==
'aliyun'
)
{
$filepath
=
PhpOffice
::
ossdowntem
(
$file
P
ath
);
$filepath
=
PhpOffice
::
ossdowntem
(
$file
p
ath
);
}
else
{
}
else
{
$filepath
=
'.'
.
strstr
(
$file
P
ath
,
'/static/'
);
$filepath
=
'.'
.
strstr
(
$file
p
ath
,
'/static/'
);
if
(
!
file_exists
(
$filepath
))
{
if
(
!
file_exists
(
$filepath
))
{
throw
new
\Exception
(
"文件不存在: "
.
$filepath
);
throw
new
\Exception
(
"文件不存在: "
.
$filepath
);
}
}
}
}
$school_user_id
=
\request
()
->
userId
;
$school_user_id
=
\request
()
->
userId
;
PhpOffice
::
chunkedImportXlsx
(
$filepath
,
function
(
$list
,
$startRow
,
$endRow
)
use
(
$checkfiled
,
$school_user_id
)
{
PhpOffice
::
chunkedImportXlsx
(
$filepath
,
function
(
$list
,
$startRow
,
$endRow
)
use
(
$checkfiled
,
$school_user_id
)
{
// echo "处理行 {$startRow} 到 {$endRow}" . PHP_EOL;
// echo "处理行 {$startRow} 到 {$endRow}" . PHP_EOL;
$datalin
=
[];
$datalin
=
[];
foreach
(
$list
[
0
]
as
$k
=>
$item
)
{
foreach
(
$list
[
0
]
as
$k
=>
$item
)
{
$thisitem
=
trim
(
$item
);
$thisitem
=
trim
(
$item
);
...
@@ -261,7 +262,9 @@ class Student extends BaseController
...
@@ -261,7 +262,9 @@ class Student extends BaseController
});
});
if
(
$fileinfo
[
'storage'
]
==
'aliyun'
)
{
if
(
$fileinfo
[
'storage'
]
==
'aliyun'
)
{
// 处理完成后删除临时文件
// 处理完成后删除临时文件
unlink
(
$filePath
);
if
(
file_exists
(
$filepath
))
{
unlink
(
$filepath
);
}
}
}
return
$this
->
returnMsg
(
'导入成功'
,
1
);
return
$this
->
returnMsg
(
'导入成功'
,
1
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
...
...
app/api/validate/CourseTeacherValidate.php
View file @
b151f173
...
@@ -11,6 +11,7 @@ class CourseTeacherValidate extends BaseValidate
...
@@ -11,6 +11,7 @@ class CourseTeacherValidate extends BaseValidate
'mobile'
=>
'mobile'
,
'mobile'
=>
'mobile'
,
'idcard'
=>
'idCard'
,
'idcard'
=>
'idCard'
,
'teacher_id'
=>
'require'
,
'teacher_id'
=>
'require'
,
'description'
=>
'max:300'
,
];
];
protected
$message
=
[
protected
$message
=
[
...
@@ -18,6 +19,7 @@ class CourseTeacherValidate extends BaseValidate
...
@@ -18,6 +19,7 @@ class CourseTeacherValidate extends BaseValidate
'teacher_id.require'
=>
'id不能为空'
,
'teacher_id.require'
=>
'id不能为空'
,
'mobile.mobile'
=>
'手机号格式错误'
,
'mobile.mobile'
=>
'手机号格式错误'
,
'idcard.idCard'
=>
'身份证格式错误'
,
'idcard.idCard'
=>
'身份证格式错误'
,
'description.max'
=>
'讲师简介字数过长'
,
];
];
}
}
\ No newline at end of file
app/api/validate/ShCourseValidate.php
View file @
b151f173
...
@@ -16,6 +16,7 @@ class ShCourseValidate extends BaseValidate
...
@@ -16,6 +16,7 @@ class ShCourseValidate extends BaseValidate
'thumb'
=>
'require'
,
'thumb'
=>
'require'
,
'detailthumb'
=>
'require'
,
'detailthumb'
=>
'require'
,
'content'
=>
'require'
,
'content'
=>
'require'
,
'description'
=>
'require'
,
];
];
...
@@ -29,7 +30,8 @@ class ShCourseValidate extends BaseValidate
...
@@ -29,7 +30,8 @@ class ShCourseValidate extends BaseValidate
'teacher_id.require'
=>
'讲师不能为空'
,
'teacher_id.require'
=>
'讲师不能为空'
,
'thumb.require'
=>
'封面图不能为空'
,
'thumb.require'
=>
'封面图不能为空'
,
'detailthumb.require'
=>
'课程详情图不能为空'
,
'detailthumb.require'
=>
'课程详情图不能为空'
,
'content.require'
=>
'课程内容不能为空'
,
'description.require'
=>
'课程简介不能为空'
,
'content.require'
=>
'课程内容不能为空'
];
];
...
...
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