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
1da2424d
Commit
1da2424d
authored
Jun 22, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习资料
parent
eb46e0a0
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1865 additions
and
18 deletions
+1865
-18
CourseCategory.php
app/admin/controller/course/CourseCategory.php
+6
-2
ProjectCategory.php
app/admin/controller/project/ProjectCategory.php
+2
-2
StudyCategory.php
app/admin/controller/study/StudyCategory.php
+110
-0
StudyInformation.php
app/admin/controller/study/StudyInformation.php
+147
-0
edit.html
app/admin/view/course/course_category/edit.html
+8
-0
index.html
app/admin/view/course/course_category/index.html
+11
-0
index.html
app/admin/view/index/index.html
+2
-2
detail.html
app/admin/view/project/project/detail.html
+1
-1
index.html
app/admin/view/project/project/index.html
+3
-3
edit.html
app/admin/view/study/study_category/edit.html
+81
-0
index.html
app/admin/view/study/study_category/index.html
+162
-0
detail.html
app/admin/view/study/study_information/detail.html
+123
-0
index.html
app/admin/view/study/study_information/index.html
+297
-0
tuijian.html
app/admin/view/study/study_information/tuijian.html
+37
-0
ShCourse.php
app/api/controller/manage/ShCourse.php
+2
-2
StudyInformation.php
app/api/controller/manage/StudyInformation.php
+131
-0
User.php
app/api/controller/manage/User.php
+6
-3
StudyInformationValidate.php
app/api/validate/StudyInformationValidate.php
+49
-0
common.php
app/common.php
+7
-1
Index22.php
app/index/controller/Index22.php
+504
-0
Project.php
app/model/Project.php
+1
-1
StudyCategory.php
app/model/StudyCategory.php
+76
-0
StudyInformation.php
app/model/StudyInformation.php
+86
-0
Business.php
app/model/project/Business.php
+6
-0
School.php
app/model/project/School.php
+7
-1
No files found.
app/admin/controller/course/CourseCategory.php
View file @
1da2424d
...
...
@@ -46,8 +46,12 @@ class CourseCategory extends AdminBase
public
function
editup
()
{
$post
=
input
();
$this
->
coursecategory
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
return
$this
->
returnMsg
(
'修改成功'
);
$result
=
$this
->
coursecategory
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
if
(
$result
)
{
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
return
$this
->
returnMsg
(
'修改成功'
);
}
}
//编辑新增分类
...
...
app/admin/controller/project/ProjectCategory.php
View file @
1da2424d
...
...
@@ -99,8 +99,8 @@ class ProjectCategory extends AdminBase
public
function
del
()
{
$post
=
input
();
$ids
=
is_array
(
$post
[
'id'
])
?
implode
(
','
,
$post
[
'id'
])
:
$post
[
'id'
];
if
(
$this
->
projectcategory
->
destroy
(
[
$ids
]))
{
//
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if
(
$this
->
projectcategory
->
destroy
(
$post
[
'id'
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
...
...
app/admin/controller/study/StudyCategory.php
0 → 100644
View file @
1da2424d
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\study
;
use
app\admin\controller\AdminBase
;
use
app\model\StudyCategory
as
StudyCategoryModel
;
use
think\App
;
use
think\facade\Db
;
use
think\facade\Validate
;
use
think\facade\Env
;
/**
* 后台主控制器
*/
class
StudyCategory
extends
AdminBase
{
protected
$studycategory
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
studycategory
=
new
StudyCategoryModel
();
}
//分类列表
public
function
index
(
string
$do
=
''
)
{
if
(
$do
==
'json'
)
{
$list
=
$this
->
studycategory
->
select
()
->
append
([
'thumbpath'
])
->
toArray
();
return
$this
->
returnMsg
(
$list
);
}
return
$this
->
fetch
(
''
,
''
,
false
);
}
//快速编辑
public
function
editup
()
{
$post
=
input
();
$result
=
$this
->
studycategory
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
if
(
$result
){
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
return
$this
->
returnMsg
(
'修改失败'
);
}
}
//编辑新增分类
public
function
edit
()
{
$post
=
input
();
if
(
$this
->
request
->
isPost
())
{
$validate
=
Validate
::
rule
([
'title'
=>
'require'
])
->
message
([
'title.require'
=>
'分类名称不能为空'
,
]);
if
(
!
$validate
->
check
(
$post
))
{
return
$this
->
returnMsg
(
$validate
->
getError
(),
0
);
}
try
{
if
(
$post
[
'id'
]
>
0
)
{
$msg
=
'更新成功'
;
$this
->
studycategory
->
update
(
$post
,
[
'id'
=>
$post
[
'id'
]]);
}
else
{
unset
(
$post
[
'id'
]);
$post
[
'createtime'
]
=
time
();
$msg
=
'添加成功'
;
$this
->
studycategory
->
save
(
$post
);
}
}
catch
(
\Exception
$e
)
{
return
$this
->
returnMsg
(
$e
->
getMessage
(),
0
);
}
return
$this
->
returnMsg
(
$msg
,
1
);
}
$data
=
Db
::
name
(
'study_category'
)
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$categorydata
=
$this
->
studycategory
->
catetree
(
isset
(
$data
[
'pid'
])
?
$data
[
'pid'
]
:
0
);
$this
->
assign
(
'categorydata'
,
$categorydata
);
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
public
function
del
()
{
$post
=
input
();
// $ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if
(
$this
->
studycategory
->
destroy
(
$post
[
'id'
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
}
\ No newline at end of file
app/admin/controller/study/StudyInformation.php
0 → 100644
View file @
1da2424d
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\study
;
use
app\admin\controller\AdminBase
;
use
app\model\StudyInformation
as
StudyInformationModel
;
use
think\App
;
use
think\facade\Db
;
use
app\model\StudyCategory
;
/**
* 后台主控制器
*/
class
StudyInformation
extends
AdminBase
{
protected
$studyinfomation
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
studyinfomation
=
new
StudyInformationModel
();
}
// 列表
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'
]];
}
if
(
isset
(
$post
[
'status'
])
&&
$post
[
'status'
]
>
-
1
)
{
$map
[]
=
[
'study_information.status'
,
'='
,
$post
[
'status'
]];
}
if
(
isset
(
$post
[
'user'
])
&&
!
empty
(
$post
[
'user'
]))
{
$hasmap
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$post
[
'user'
]
.
'%'
];
}
$list
=
$this
->
studyinfomation
->
where
(
$map
)
->
hasWhere
(
'getuserdata'
,
$hasmap
)
->
with
([
'studycatedata'
,
'getuserdata'
])
->
append
([
'type_text'
,
'status_text'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$category
=
StudyCategory
::
field
(
'*,pid as parentid'
)
->
order
(
'sort desc'
)
->
select
()
->
toArray
();
$this
->
assign
(
'category'
,
json_encode
(
$category
));
$this
->
assign
(
'limit'
,
$limit
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//快速编辑
public
function
editup
()
{
$post
=
input
();
$result
=
$this
->
studyinfomation
->
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
->
studyinfomation
->
destroy
(
$post
[
'id'
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
//详情
public
function
detail
()
{
$post
=
input
();
$info
=
$this
->
studyinfomation
->
where
(
'id'
,
$post
[
'id'
])
->
with
([
'studycatedata'
,
'getuserdata'
])
->
find
()
->
append
([
'status_text'
,
'type_text'
]);
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//推荐
public
function
tuijian
()
{
$post
=
input
();
if
(
$this
->
request
->
isAjax
())
{
$data
[
'is_hot'
]
=
isset
(
$post
[
'is_hot'
])
?
$post
[
'is_hot'
]
:
0
;
$data
[
'is_tj'
]
=
isset
(
$post
[
'is_tj'
])
?
$post
[
'is_tj'
]
:
0
;
$this
->
studyinfomation
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$data
);
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
$info
=
$this
->
studyinfomation
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//审核
public
function
shenhestudyinfomation
()
{
$post
=
input
();
$errordesc
=
''
;
$shstatus
=
2
;
//通过
if
(
$post
[
'shstatus'
]
==
2
)
{
if
(
empty
(
$post
[
'errordesc'
]))
{
return
$this
->
returnMsg
(
"请输入失败原因"
);
}
$errordesc
=
$post
[
'errordesc'
];
$shstatus
=
1
;
//失败
}
$updatedata
[
'status'
]
=
$shstatus
;
$updatedata
[
'status_desc'
]
=
$errordesc
;
$result
=
$this
->
studyinfomation
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
}
}
}
\ No newline at end of file
app/admin/view/course/course_category/edit.html
View file @
1da2424d
...
...
@@ -30,7 +30,15 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
推荐分类
</label>
<div
class=
"layui-input-block"
>
<input
type=
"radio"
name=
"is_tj"
value=
"0"
title=
"否"
checked
{
eq
name=
"$data.is_tj|default=''"
value=
"0"
}
checked
{/
eq
}
>
<input
type=
"radio"
name=
"is_tj"
value=
"1"
title=
"是"
{
eq
name=
"$data.is_tj|default=''"
value=
"1"
}
checked
{/
eq
}
>
</div>
<div
class=
"layui-form-mid"
><i
class=
"layui-icon"
>
</i>
设计推荐分类可显示AI工坊页面
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
"{$data.id|default=0}"
>
</form>
...
...
app/admin/view/course/course_category/index.html
View file @
1da2424d
...
...
@@ -56,6 +56,7 @@
{
field
:
'title'
,
align
:
'left'
,
title
:
'分类'
,
edit
:
'text'
},
{
field
:
'thumb'
,
width
:
50
,
align
:
'center'
,
title
:
'缩略图'
,
templet
:
'<div><div class="files_itemw1"><img src="{{d.thumbpath}}" lay-event="article-event-image" /></div></div>'
},
{
field
:
'sort'
,
width
:
50
,
align
:
'center'
,
title
:
'排序'
,
edit
:
'text'
},
{
field
:
"is_tj"
,
width
:
80
,
align
:
'center'
,
title
:
"是否推荐"
,
templet
:
function
(
d
){
return
'<input type="checkbox" name="is_tj" lay-skin="switch" lay-text="是|否" lay-filter="is_tj-chang" value="'
+
d
.
is_tj
+
'" data-json="'
+
encodeURIComponent
(
JSON
.
stringify
(
d
))
+
'"'
+
(
d
.
is_tj
==
1
?
' checked'
:
''
)
+
'>'
;},
unresize
:
true
,},
{
fixed
:
'right'
,
width
:
130
,
align
:
'center'
,
toolbar
:
'<div><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>'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="coursecategory"]'
));
}
...
...
@@ -74,6 +75,16 @@
ob
.
attr
(
'data'
,
i
).
html
(
t
);
});
/**/
// 状态 - 开关操作
form
.
on
(
'switch(is_tj-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
});
});
/*快编监听*/
treeTable
.
on
(
'edit(coursecategory)'
,
function
(
obj
){
...
...
app/admin/view/index/index.html
View file @
1da2424d
...
...
@@ -40,8 +40,8 @@
<ul
class=
"layui-nav layui-layout-right"
>
<li
class=
"layui-nav-item"
id=
"new_dsh"
style=
"display: none;"
><a
title=
"有新的待审核"
href=
"#/index/main"
style=
"color: #ff2638;"
class=
"dshbounce"
>
有新的待审核(10)
</a></li>
<li
class=
"layui-nav-item"
lay-unselect
><a
v-event=
"clearCache"
title=
"缓存"
data-url=
"{$appMap}/index/clear"
><i
class=
"layui-icon layui-icon-clear"
></i></a></li>
<li
class=
"layui-nav-item"
lay-unselect
><a
href=
"
{PUBLIC__PATH}/
"
target=
"_blank"
title=
"前台"
><i
class=
"layui-icon layui-icon-website"
></i></a></li>
<li
class=
"layui-nav-item"
lay-unselect
><a
v-event=
"lockScreen"
data-url=
"{PUBLIC__PATH}/static/admin/page/tpl/lock.html"
title=
"锁屏"
><i
class=
"layui-icon layui-icon-password"
></i></a></li
>
<li
class=
"layui-nav-item"
lay-unselect
><a
href=
"
https://www.kuajingxl.com
"
target=
"_blank"
title=
"前台"
><i
class=
"layui-icon layui-icon-website"
></i></a></li>
<!-- <li class="layui-nav-item" lay-unselect><a v-event="lockScreen" data-url="{PUBLIC__PATH}/static/admin/page/tpl/lock.html" title="锁屏"><i class="layui-icon layui-icon-password"></i></a></li>--
>
<li
class=
"layui-nav-item"
lay-unselect
><a
v-event=
"fullScreen"
title=
"全屏"
><i
class=
"layui-icon layui-icon-screen-full"
></i></a></li>
<li
class=
"layui-nav-item"
lay-unselect
>
<a><img
src=
""
id=
"vFace"
class=
"layui-nav-img"
alt=
"Face"
/><cite
id=
"vUser"
></cite></a>
...
...
app/admin/view/project/project/detail.html
View file @
1da2424d
...
...
@@ -168,7 +168,7 @@
{
field
:
'title'
,
width
:
200
,
align
:
'center'
,
title
:
'申请人'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'mobile'
,
width
:
120
,
align
:
'center'
,
title
:
'申请人手机号'
,
templet
:
'<div>{{= d.getuserdata.mobile}}</div>'
},
{
field
:
'createtime'
,
width
:
150
,
align
:
'center'
,
title
:
'申请日期'
},
{
field
:
'sh_status'
,
width
:
100
,
align
:
'center'
,
title
:
'
审核
状态'
,
templet
:
'#put-demo'
},
{
field
:
'sh_status'
,
width
:
100
,
align
:
'center'
,
title
:
'
申请
状态'
,
templet
:
'#put-demo'
},
{
field
:
'status'
,
width
:
100
,
align
:
'center'
,
title
:
'作品状态'
,
templet
:
'#putstatus-demo'
},
{
field
:
'user_desc'
,
width
:
300
,
align
:
'center'
,
title
:
'个人介绍'
},
{
fixed
:
'right'
,
width
:
130
,
align
:
'center'
,
toolbar
:
'<div><a class="layui-btn layui-btn-xs" lay-event="fileclcik">查看附件</a></div>'
,
title
:
'操作'
}
...
...
app/admin/view/project/project/index.html
View file @
1da2424d
...
...
@@ -165,9 +165,9 @@
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'sn'
,
align
:
'center'
,
title
:
'项目编号'
},
{
field
:
'username'
,
align
:
'center'
,
title
:
'发布者'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'title'
,
align
:
'center'
,
title
:
'项目名称'
},
{
field
:
'sn'
,
align
:
'center'
,
width
:
160
,
title
:
'项目编号'
},
{
field
:
'username'
,
align
:
'center'
,
width
:
130
,
title
:
'发布者'
,
templet
:
'<div>{{= d.getuserdata.username}}</div>'
},
{
field
:
'title'
,
align
:
'center'
,
width
:
240
,
title
:
'项目名称'
},
{
field
:
'cate_name'
,
width
:
120
,
align
:
'center'
,
title
:
'类别'
,
templet
:
'<div>{{= d.projectcatedata.title}}</div>'
},
{
field
:
'yusuan'
,
width
:
120
,
align
:
'center'
,
title
:
'预算'
},
{
field
:
'zhouqi'
,
width
:
120
,
align
:
'center'
,
title
:
'周期/天'
},
...
...
app/admin/view/study/study_category/edit.html
0 → 100644
View file @
1da2424d
{extend name="base/header" /}
{block name="body"}
<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"
>
<select
name=
"pid"
>
<option
value=
""
>
请选择分类
</option>
{:$categorydata}
</select>
</div>
</div>
<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>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
分类图片
</label>
<div
class=
"layui-input-block"
id=
"thumbup"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
推荐分类
</label>
<div
class=
"layui-input-block"
>
<input
type=
"radio"
name=
"is_tj"
value=
"0"
title=
"否"
checked
{
eq
name=
"$data.is_tj|default=''"
value=
"0"
}
checked
{/
eq
}
>
<input
type=
"radio"
name=
"is_tj"
value=
"1"
title=
"是"
{
eq
name=
"$data.is_tj|default=''"
value=
"1"
}
checked
{/
eq
}
>
</div>
<!-- <div class="layui-form-mid"><i class="layui-icon"></i> 设计推荐分类可显示在项目工坊页面</div>-->
</div>
<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
()
{
var
form
=
layui
.
form
;
/*解析顶部分组选项*/
var
str
=
[{
"name"
:
"thumb"
,
"title"
:
"上传图片"
,
"value"
:
"{$data.thumb|default=''|get_upload_file}"
,
"pathid"
:
"{$data.thumb|default=''}"
,
"type"
:
"imagewt"
}];
layui
.
buildItems
.
build
({
fjbid
:
'fjfrom'
,
bid
:
'thumbup'
,
url
:
''
,
map
:
layui
.
cache
.
maps
+
'system.upload/'
,
gid
:
1
,
data
:
str
});
layui
.
buildItems
.
init
();
form
.
render
();
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/admin/view/study/study_category/index.html
0 → 100644
View file @
1da2424d
<div
class=
"layui-fluid"
>
<style>
.files_itemw1
{
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_itemw1
img
{
max-width
:
28px
;
max-height
:
28px
;
border
:
0
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
<form
class=
"layui-form render"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-btn-group"
>
<a
class=
"layui-btn"
id=
"studycategory-sz"
data=
"1"
><i
class=
"layui-icon"
>

</i>
展开
</a>
<a
class=
"layui-btn"
id=
"studycategory-add"
><i
class=
"layui-icon layui-icon-add-circle"
></i>
添加
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-body"
>
<table
lay-filter=
"studycategory"
id=
"studycategory"
></table>
</div>
</div>
</div>
</div>
<!--JS部分-->
<script>
layui
.
use
([
'trTable'
,
'vinfo'
,
'buildItems'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'study.study_category/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
,
treeTable
=
layui
.
trTable
;
/*渲染数据*/
var
studycategorycateTb
=
treeTable
.
render
({
elem
:
'#studycategory'
,
checkdd
:
false
,
url
:
app_root
+
"index?&do=json"
,
tree
:
{
iconIndex
:
1
,
isPidData
:
true
,
idName
:
'id'
,
pidName
:
'pid'
,
arrowType
:
'arrow2'
,
getIcon
:
'v-tree-icon-style2'
},
cols
:
[[
{
field
:
'id'
,
width
:
50
,
align
:
'center'
,
title
:
'ID'
},
{
field
:
'title'
,
align
:
'left'
,
title
:
'分类'
,
edit
:
'text'
},
{
field
:
'thumb'
,
width
:
50
,
align
:
'center'
,
title
:
'缩略图'
,
templet
:
'<div><div class="files_itemw1"><img src="{{d.thumbpath}}" lay-event="article-event-image" /></div></div>'
},
{
field
:
'sort'
,
width
:
50
,
align
:
'center'
,
title
:
'排序'
,
edit
:
'text'
},
{
field
:
"is_tj"
,
width
:
80
,
align
:
'center'
,
title
:
"是否推荐"
,
templet
:
function
(
d
){
return
'<input type="checkbox" name="is_tj" lay-skin="switch" lay-text="是|否" lay-filter="is_tj-chang" value="'
+
d
.
is_tj
+
'" data-json="'
+
encodeURIComponent
(
JSON
.
stringify
(
d
))
+
'"'
+
(
d
.
is_tj
==
1
?
' checked'
:
''
)
+
'>'
;},
unresize
:
true
,},
{
fixed
:
'right'
,
width
:
130
,
align
:
'center'
,
toolbar
:
'<div><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>'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="studycategory"]'
));
}
});
// 状态 - 开关操作
form
.
on
(
'switch(is_tj-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
});
});
/*展开或折叠*/
$
(
'#studycategory-sz'
).
click
(
function
(){
var
ob
=
$
(
this
),
i
,
t
;
if
(
ob
.
attr
(
'data'
)
==
1
){
studycategorycateTb
.
expandAll
();
i
=
0
;
t
=
'<i class="layui-icon"></i>折叠'
;
}
else
{
studycategorycateTb
.
foldAll
();
i
=
1
;
t
=
'<i class="layui-icon"></i>展开'
;
}
ob
.
attr
(
'data'
,
i
).
html
(
t
);
});
/**/
/*快编监听*/
treeTable
.
on
(
'edit(studycategory)'
,
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
});
});
/**/
/*工具条监听*/
treeTable
.
on
(
'tool(studycategory)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'edit'
){
studycategoryOpen
(
data
.
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'article-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'
]});
}
});
/**/
/*删除*/
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
)
studycategorycateTb
.
refresh
();
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
$
(
'#studycategory-add'
).
on
(
'click'
,
function
(){
studycategoryOpen
();});
/**/
/*弹出窗*/
function
studycategoryOpen
(
id
=
''
){
if
(
id
>
0
){
var
title
=
'编辑分类'
;
}
else
{
var
title
=
'添加分类'
;
}
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'90%'
],
title
:
title
,
btn
:
[
'确定'
,
'关闭'
],
content
:
app_root
+
'edit?id='
+
id
,
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
);
studycategorycateTb
.
refresh
();
});
}
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/study/study_information/detail.html
0 → 100644
View file @
1da2424d
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
</style>
<div
style=
"margin: 0px 10px"
>
<table
class=
"layui-table"
>
<tbody>
<tr>
<td
class=
"widthtd"
><strong>
资料名称
</strong></td>
<td>
{$info.title}
</td>
<td
class=
"widthtd"
><strong>
资料类型
</strong></td>
<td>
{$info.type_text}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
发布者
</strong></td>
<td>
{$info.getuserdata.username}
</td>
<td
class=
"widthtd"
><strong>
类别
</strong></td>
<td>
{$info.studycatedata.title}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
审核状态
</strong></td>
<td
>
{if $info.status == 1}
{$info.status_text} - {$info.status_desc}
{else /}
{$info.status_text}
{/if}
</td>
<td
class=
"widthtd"
><strong>
创建时间
</strong></td>
<td>
{$info.createtime}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
资料简介
</strong></td>
<td
colspan=
"4"
>
{$info.description}
</td>
</tr>
{if $info.type != 'content'}
<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>
<tr>
<td>
{$info.filepath.filename}
</td>
<td>
{$info.filepath.filesize}KB
</td>
<td
>
{in name="info.filepath.fileext" value="jpg,png,jpeg"}
<img
src=
"{$info.filepath.fileurl}"
width=
"50"
height=
"50"
class=
"imgclick"
>
{else/}
<a
class=
"layui-btn layui-btn-xs"
href=
"/admin/study.study_information/downloadfile?fileid={$info.filepath.fileid}"
target=
"_blank"
>
下载
</a>
{/in}
</td>
</tr>
</tbody>
</table>
</td>
</tr>
{/if}
</tbody>
</table>
{if $info.type == 'content'}
<div
class=
"layui-tab layui-tab-card"
lay-filter=
"proputdemotest"
>
<ul
class=
"layui-tab-title"
>
<li
class=
"layui-this"
>
资料内容
</li>
</ul>
<div
class=
"layui-tab-content"
style=
" background: #fff;"
>
<div
class=
"layui-tab-item layui-show"
>
<style>
.projectdetail
{
width
:
95%
;
margin
:
10px
auto
;}
.projectdetail
img
{
width
:
100%
;
height
:
auto
;}
</style>
<div
class=
"projectdetail"
>
{$info.content|raw}
</div>
</div>
</div>
</div>
{/if}
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
$
(
".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
()
{
};
</script>
{/block}
\ No newline at end of file
app/admin/view/study/study_information/index.html
0 → 100644
View file @
1da2424d
This diff is collapsed.
Click to expand it.
app/admin/view/study/study_information/tuijian.html
0 → 100644
View file @
1da2424d
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
</style>
<div
style=
"margin: 0px 20px 0px 0px; background: #fff;"
>
<form
class=
"layui-form layui-form-pane"
style=
"margin-top: 20px;"
id=
"fjfrom"
>
<div
class=
"layui-form-item"
pane=
""
>
<label
class=
"layui-form-label"
>
推荐
</label>
<div
class=
"layui-input-block"
>
<input
type=
"checkbox"
name=
"is_hot"
value=
"1"
title=
"热门"
{
eq
name=
"$info.is_hot|default=''"
value=
"1"
}
checked
{/
eq
}
>
<input
type=
"checkbox"
name=
"is_tj"
value=
"1"
title=
"推荐"
{
eq
name=
"$info.is_tj|default=''"
value=
"1"
}
checked
{/
eq
}
>
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
"{$info.id|default=0}"
>
</form>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
var
course_id
=
"{$info.id}"
;
layui
.
use
([
'buildItems'
,
'form'
],
function
()
{
var
form
=
layui
.
form
;
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/api/controller/manage/ShCourse.php
View file @
1da2424d
...
...
@@ -119,7 +119,7 @@ class ShCourse extends BaseController
//添加课程
public
function
createShCourse
(
Request
$request
)
{
$filed
=
[
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
];
$filed
=
[
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
,
'is_zb'
];
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
return
$vo
;
...
...
@@ -135,7 +135,7 @@ class ShCourse extends BaseController
//修改课程
public
function
editShCourse
(
Request
$request
)
{
$filed
=
[
'course_id'
,
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
];
$filed
=
[
'course_id'
,
'title'
,
'cate_id'
,
'thumb'
,
'teacher_id'
,
'detailthumb'
,
'content'
,
'tag_ids'
,
'teacher_id'
,
'price'
,
'description'
,
'is_zb'
];
$vo
=
(
new
ShCourseValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
return
$vo
;
...
...
app/api/controller/manage/StudyInformation.php
0 → 100644
View file @
1da2424d
<?php
namespace
app\api\controller\manage
;
use
app\api\middleware\Auth
;
use
app\BaseController
;
use
app\model\StudyInformation
as
StudyInformationModel
;
use
app\model\StudyCategory
;
use
app\Request
;
use
think\facade\Db
;
use
app\api\validate\StudyInformationValidate
;
class
StudyInformation
extends
BaseController
{
protected
$middleware
=
[
Auth
::
class
,
];
//添加学习资料
public
function
addStudyInformation
(
Request
$request
)
{
$filed
=
[
'title'
,
'type'
,
'file_id'
,
'content'
,
'price'
,
'cate_id'
,
'description'
];
$vo
=
(
new
StudyInformationValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$data
=
$request
->
only
(
$filed
);
$data
[
'user_id'
]
=
$request
->
userId
;
$result
=
StudyInformationModel
::
create
(
$data
);
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$result
);
}
/*
* 编辑学习资料
*/
public
function
editStudyInformation
(
Request
$request
)
{
$filed
=
[
'study_information_id'
,
'title'
,
'type'
,
'file_id'
,
'content'
,
'price'
,
'cate_id'
,
'description'
];
$vo
=
(
new
StudyInformationValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$info
=
StudyInformationModel
::
where
([
'id'
=>
$parm
[
'study_information_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
if
(
$info
[
'status'
]
==
2
)
{
return
$this
->
returnMsg
(
'已审核不能编辑'
);
}
$udpatedata
=
$request
->
only
(
$filed
);
unset
(
$udpatedata
[
'study_information_id'
]);
$result
=
$info
->
save
(
$udpatedata
);
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$result
);
}
//删除学习资料
public
function
deleteStudyInformation
(
Request
$request
)
{
$filed
=
[
'study_information_id'
];
$vo
=
(
new
StudyInformationValidate
())
->
goCheck
(
$filed
);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$info
=
StudyInformationModel
::
where
([
'id'
=>
$parm
[
'study_information_id'
],
'user_id'
=>
$request
->
userId
])
->
find
();
if
(
empty
(
$info
))
{
return
$this
->
returnMsg
(
'不存在或无权删除'
);
}
$result
=
$info
->
delete
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$result
);
}
//学习资料列表
public
function
listStudyInformation
(
Request
$request
)
{
$parm
=
$request
->
param
();
$where
=
[
'user_id'
=>
$request
->
userId
];
$map
=
[];
if
(
isset
(
$parm
[
'searchKeyWords'
])
&&
$parm
[
'searchKeyWords'
])
{
$map
[]
=
[
'title'
,
'like'
,
'%'
.
$parm
[
'searchKeyWords'
]
.
'%'
];
}
if
(
isset
(
$parm
[
'status'
])
&&
(
$parm
[
'status'
]
||
$parm
[
'status'
]
===
'0'
))
{
$map
[]
=
[
'status'
,
'='
,
$parm
[
'status'
]];
}
if
(
isset
(
$parm
[
'cate_id'
])
&&
$parm
[
'cate_id'
])
{
$map
[]
=
[
'cate_id'
,
'='
,
$parm
[
'cate_id'
]];
}
$page
=
$request
->
param
(
'page'
,
1
);
$pageSize
=
$request
->
param
(
'pageSize'
,
10
);
$list
=
StudyInformationModel
::
where
(
$where
)
->
where
(
$map
)
->
order
(
'createtime desc'
)
->
with
([
'filepath'
,
'studycatedata'
])
->
append
([
'status_text'
])
->
paginate
([
'page'
=>
$page
,
'list_rows'
=>
$pageSize
]);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
//修改学习资料属性
public
function
updatestudyinfomationinfo
(
Request
$request
)
{
$vo
=
(
new
StudyInformationValidate
())
->
goCheck
([
'study_information_id'
,
'updateField'
,
'updateValue'
]);
if
(
$vo
!==
true
)
{
return
$vo
;
}
$parm
=
$request
->
param
();
$where
=
[
'id'
=>
$parm
[
'study_information_id'
],
'user_id'
=>
$request
->
userId
];
if
(
$parm
[
'updateField'
]
==
'is_sell'
){
$status
=
StudyInformationModel
::
where
(
$where
)
->
value
(
'status'
);
if
(
$status
!=
2
){
return
$this
->
returnMsg
(
'审核未通过不能上下架'
);
}
}
$result
=
StudyInformationModel
::
where
(
$where
)
->
update
([
$parm
[
'updateField'
]
=>
$parm
[
'updateValue'
]]);
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$result
);
}
//学习资料分类列表
public
function
getStudyCategoryList
()
{
$list
=
(
new
StudyCategory
)
->
getStudyCategoryList
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$list
);
}
}
\ No newline at end of file
app/api/controller/manage/User.php
View file @
1da2424d
...
...
@@ -27,6 +27,7 @@ class User extends BaseController
$info
=
Business
::
where
([
'user_id'
=>
$request
->
userId
,
'is_del'
=>
'0'
])
->
with
([
'businessQualification'
,
'businessfrsfzqian'
,
'businessfrsfzhou'
])
->
append
([
'provice_city'
])
->
find
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$info
);
...
...
@@ -38,6 +39,7 @@ class User extends BaseController
$info
=
School
::
where
([
'user_id'
=>
$request
->
userId
,
'is_del'
=>
'0'
])
->
with
([
'schoolQualification'
,
'schoolfrsfzqian'
,
'schoolfrsfzhou'
])
->
append
([
'provice_city'
])
->
find
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$info
);
...
...
@@ -92,6 +94,9 @@ class User extends BaseController
}
$keyword
=
$request
->
param
(
'keyword'
,
''
);
if
(
$keyword
)
{
$where
[
'subject'
]
=
[
'like'
,
"%
{
$keyword
}
%"
];
}
$query
=
Payment
::
where
(
$where
)
// ->leftJoin('course c', "p.order_id = c.id AND p.order_type = 1")
...
...
@@ -114,9 +119,7 @@ class User extends BaseController
->
with
([
'getuserdata'
])
->
append
([
'pay_method_text'
,
'pay_status_text'
,
'pay_time_text'
]);
if
(
$keyword
)
{
$query
=
$query
->
where
(
'p.subject'
,
'like'
,
"%
{
$keyword
}
%"
);
}
$list
=
$query
->
order
(
'createtime'
,
'desc'
)
->
paginate
([
...
...
app/api/validate/StudyInformationValidate.php
0 → 100644
View file @
1da2424d
<?php
namespace
app\api\validate
;
class
StudyInformationValidate
extends
BaseValidate
{
protected
$rule
=
[
'study_information_id'
=>
'require'
,
'title'
=>
'require'
,
'type'
=>
'require'
,
'cate_id'
=>
'require'
,
'price'
=>
'between:0,99999'
,
'file_id'
=>
'requireCallback:filecontentcheck'
,
'content'
=>
'requireCallback:contentcheck'
,
'updateField'
=>
'require|in:is_sell'
,
'updateValue'
=>
'require'
,
];
protected
$message
=
[
'study_information_id.require'
=>
'资料id不能为空'
,
'title.require'
=>
'标题不能为空'
,
'cate_id.require'
=>
'请选择分类'
,
'type.require'
=>
'请选择类型'
,
'price.between'
=>
'金额错误'
,
'file_id.requireCallback'
=>
'请上传文件'
,
'content.requireCallback'
=>
'请填写内容'
,
'updateField.require'
=>
'必填项不能为空'
,
'updateValue.require'
=>
'必填项不能为空'
,
];
protected
function
filecontentcheck
(
$value
,
$data
=
[])
{
if
(
$data
[
'type'
]
!=
'content'
)
{
return
true
;
}
}
protected
function
contentcheck
(
$value
,
$data
=
[])
{
if
(
$data
[
'type'
]
==
'content'
)
{
return
true
;
}
}
}
\ No newline at end of file
app/common.php
View file @
1da2424d
...
...
@@ -32,6 +32,7 @@ define('ADDON_PATH', ROOT_PATH . 'addons' . VT_DS);
define
(
'RUNTIME_PATH'
,
ROOT_PATH
.
'runtime'
.
VT_DS
);
use
app\model\system\SystemUploadFile
;
use
app\model\system\SystemArea
;
//获取图片地址
function
get_upload_file
(
$fileid
=
''
,
$datatype
=
''
)
{
...
...
@@ -50,7 +51,12 @@ function get_upload_file($fileid = '', $datatype = '')
}
//从阿里云
//获取地区名称
function
get_area_name
(
$areaid
)
{
return
SystemArea
::
where
(
'areaid'
,
$areaid
)
->
value
(
'areaname'
);
}
/**
* md5判断
...
...
app/index/controller/Index22.php
0 → 100644
View file @
1da2424d
This diff is collapsed.
Click to expand it.
app/model/Project.php
View file @
1da2424d
...
...
@@ -249,7 +249,7 @@ class Project extends Model
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'thumb'
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype'
);
->
field
(
'fileid,filename,filesize,fileurl,filetype
,storage
'
);
}
...
...
app/model/StudyCategory.php
0 → 100644
View file @
1da2424d
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\model
;
use
app\model\system\SystemUploadFile
;
use
think\facade\Db
;
use
think\Model
;
use
think\model\concern\SoftDelete
;
use
tool\Tree
;
/**
* 模型公用类
*/
class
StudyCategory
extends
Model
{
use
SoftDelete
;
protected
$deleteTime
=
'deletetime'
;
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
public
function
catetree
(
$cate_id
=
0
)
{
$category
=
$this
->
order
(
'sort desc'
)
->
select
()
->
toArray
();
$tree
=
new
Tree
();
$tree
->
icon
=
[
' │ '
,
' ├─ '
,
' └─ '
];
$tree
->
nbsp
=
' '
;
$str
=
"<option value=@id @selected @disabled>@spacer @title</option>"
;
$tree
->
init
(
$category
);
$categorydata
=
$tree
->
getTree
(
0
,
$str
,
$cate_id
);
return
$categorydata
;
}
public
function
getThumbpathAttr
(
$value
,
$data
)
{
return
get_upload_file
(
$data
[
'thumb'
]);
}
public
function
children
()
{
return
$this
->
hasMany
(
StudyCategory
::
class
,
'pid'
);
}
public
function
thumb
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'thumb'
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype,storage'
);
}
public
function
getStudyCategoryList
(
$pid
=
0
)
{
return
$this
->
with
([
'children'
=>
function
(
$query
)
{
$query
->
order
(
'sort'
,
'desc'
);
$query
->
with
([
'thumb'
]);
},
'thumb'
])
->
where
(
'pid'
,
$pid
)
->
order
(
'sort'
,
'desc'
)
->
select
();
}
}
\ No newline at end of file
app/model/StudyInformation.php
0 → 100644
View file @
1da2424d
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\model
;
use
app\api\service\UtilService
;
use
app\model\project\User
;
use
app\model\system\SystemUploadFile
;
use
think\facade\Db
;
use
think\Model
;
use
think\model\concern\SoftDelete
;
/**
* 课程模型
*/
class
StudyInformation
extends
Model
{
use
SoftDelete
;
protected
$deleteTime
=
'deletetime'
;
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
'updatetime'
;
public
function
getStatusTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'status'
])
{
case
1
:
$statustxt
=
'审核失败'
;
break
;
case
2
:
$statustxt
=
'审核成功'
;
break
;
default
:
$statustxt
=
'待审核'
;
}
return
$statustxt
;
}
public
function
getTypeTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'type'
])
{
case
'content'
:
$statustxt
=
'文本'
;
break
;
default
:
$statustxt
=
$data
[
'type'
];
}
return
$statustxt
;
}
public
function
studycatedata
()
{
return
$this
->
hasOne
(
StudyCategory
::
class
,
'id'
,
'cate_id'
)
->
field
(
'id,title'
);
}
//用户信息
public
function
getuserdata
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
)
->
field
(
'username,mobile,id'
);
}
//附件
public
function
filepath
()
{
return
$this
->
hasOne
(
SystemUploadFile
::
class
,
'fileid'
,
'file_id'
)
->
where
(
'isdel'
,
0
);
}
}
\ No newline at end of file
app/model/project/Business.php
View file @
1da2424d
...
...
@@ -120,6 +120,12 @@ class Business extends Model
return
$data
[
'province'
]
.
'-'
.
$data
[
'city'
]
.
'-'
.
$data
[
'area'
];
}
//所在地区
public
function
getProviceCityAttr
(
$value
,
$data
)
{
return
get_area_name
(
$data
[
'province'
])
.
'-'
.
get_area_name
(
$data
[
'city'
]);
}
public
function
getStatusTextAttr
(
$value
,
$data
)
{
switch
(
$data
[
'status'
])
{
...
...
app/model/project/School.php
View file @
1da2424d
...
...
@@ -115,7 +115,13 @@ class School extends Model
//详细地址
public
function
getAddressxxAttr
(
$value
,
$data
)
{
return
$data
[
'province'
]
.
'-'
.
$data
[
'city'
]
.
'-'
.
$data
[
'area'
];
return
get_area_name
(
$data
[
'province'
])
.
'-'
.
get_area_name
(
$data
[
'city'
])
.
'-'
.
$data
[
'area'
];
}
//所在地区
public
function
getProviceCityAttr
(
$value
,
$data
)
{
return
get_area_name
(
$data
[
'province'
])
.
'-'
.
get_area_name
(
$data
[
'city'
]);
}
public
function
getStatusTextAttr
(
$value
,
$data
)
...
...
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