Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
land_army
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
land_army
Commits
26e725e2
Commit
26e725e2
authored
May 26, 2022
by
sugar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reward
parent
d8275b1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
application/index/controller/Index.php
application/index/controller/Index.php
+22
-0
No files found.
application/index/controller/Index.php
View file @
26e725e2
...
...
@@ -8,6 +8,7 @@ use app\admin\model\CourseArticleModel;
use
app\admin\model\AdresourceModel
;
use
app\common\model\Config
as
ConfigModel
;
use
app\common\model\AdModel
;
use
app\common\model\CourseVideoModel
;
use
think\Db
;
...
...
@@ -41,6 +42,13 @@ class Index extends Frontend
$CourseArticles
[
$key
][
'content'
]
=
mb_substr
(
$val
[
'content'
],
0
,
45
)
.
'...'
;
}
}
$CourseArticleList
=
CourseArticleModel
::
where
([
'class_id'
=>
[
'in'
,
$dynamic_class_ids
],
'index_type'
=>
1
])
->
order
(
'orderby asc'
)
->
limit
(
6
)
->
select
();
foreach
(
$CourseArticleList
as
$ke
=>
$va
){
$CourseArticleList
[
$ke
][
'title'
]
=
mb_substr_content
(
$va
[
'title'
],
25
);
$CourseArticleList
[
$ke
][
'day'
]
=
date
(
'd'
,
$va
[
'createtime'
]);
$CourseArticleList
[
$ke
][
'month'
]
=
date
(
'Y-m'
,
$va
[
'createtime'
]);
}
}
//教学公告
...
...
@@ -60,6 +68,19 @@ class Index extends Frontend
//教学运行
$teachrun_id
=
3
;
$teachrunclass
=
CourseClassModel
::
where
([
'pid'
=>
$teachrun_id
])
->
field
(
'id,image_url,title'
)
->
select
();
foreach
(
$teachrunclass
as
$key
=>
$val
){
if
(
$val
[
'id'
]
==
45
){
//在线课堂
$TeachRunArticles
=
CourseVideoModel
::
where
([
'class_id'
=>
$val
[
'id'
]])
->
order
(
'createtime desc'
)
->
limit
(
5
)
->
select
();
}
else
{
$TeachRunArticles
=
CourseArticleModel
::
where
([
'class_id'
=>
$val
[
'id'
]])
->
order
(
'createtime desc'
)
->
limit
(
5
)
->
select
();
}
foreach
(
$TeachRunArticles
as
$k
=>
$v
){
$TeachRunArticles
[
$k
][
'title'
]
=
mb_substr_content
(
$v
[
'title'
],
25
);
$TeachRunArticles
[
$k
][
'day'
]
=
date
(
'd'
,
$v
[
'createtime'
]);
$TeachRunArticles
[
$k
][
'month'
]
=
date
(
'Y-m'
,
$v
[
'createtime'
]);
}
$teachrunclass
[
$key
][
'TeachArticles'
]
=
$TeachRunArticles
;
}
//课程资源
$course_id
=
4
;
$courseclass
=
CourseClassModel
::
where
([
'pid'
=>
$course_id
])
->
field
(
'id,image_url,title'
)
->
select
();
...
...
@@ -88,6 +109,7 @@ class Index extends Frontend
$this
->
view
->
assign
(
"dynamic_id"
,
$dynamic_id
);
$this
->
view
->
assign
(
"indexbanner"
,
$indexbanner
);
$this
->
view
->
assign
(
"CourseArticles"
,
$CourseArticles
);
$this
->
view
->
assign
(
"CourseArticleList"
,
$CourseArticleList
);
$this
->
view
->
assign
(
"powerbanner"
,
$powerbanner
);
$this
->
view
->
assign
(
"teachclass"
,
$teachclass
);
$this
->
view
->
assign
(
"teachrunclass"
,
$teachrunclass
);
...
...
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