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
1b287906
Commit
1b287906
authored
Jun 08, 2022
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
留言板
parent
152b3c0b
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
62 deletions
+151
-62
application/common/model/ReleaseArticleModel.php
application/common/model/ReleaseArticleModel.php
+66
-0
application/index/controller/Interactive.php
application/index/controller/Interactive.php
+19
-5
application/index/view/common/headnavs.html
application/index/view/common/headnavs.html
+6
-2
application/index/view/index/interactdiscuss.html
application/index/view/index/interactdiscuss.html
+60
-55
No files found.
application/common/model/ReleaseArticleModel.php
View file @
1b287906
...
@@ -27,4 +27,70 @@ class ReleaseArticleModel Extends Model
...
@@ -27,4 +27,70 @@ class ReleaseArticleModel Extends Model
}
}
return
$list
;
return
$list
;
}
}
/**
* 全部讨论区
*/
public
static
function
allReleaseArticle
(
$where
,
$pageSize
=
10
,
$param
){
$list
=
self
::
where
(
$where
)
->
field
(
'*,FROM_UNIXTIME(createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'createtime desc'
)
->
paginate
(
$pageSize
,
false
,[
'query'
=>
$param
]);
return
$list
;
}
/**
* 等待回复
*/
public
static
function
awaitReleaseReply
(
$where
,
$pageSize
=
10
,
$param
){
$list
=
self
::
alias
(
"a"
)
->
join
(
"release_reply r"
,
"r.release_id= a.id"
,
"LEFT"
)
->
where
(
$where
)
->
where
(
"r.id IS NULL"
)
->
field
(
'a.*,FROM_UNIXTIME(a.createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'a.createtime desc'
)
->
group
(
"a.id"
)
->
paginate
(
$pageSize
,
false
,[
'query'
=>
$param
]);
//echo self::getLastSql();
return
$list
;
}
/**
* 教师回复留言
*/
public
static
function
teacherReleaseReply
(
$where
,
$pageSize
=
10
,
$param
){
$list
=
self
::
alias
(
"a"
)
->
join
(
"release_reply r"
,
"r.release_id= a.id"
,
"LEFT"
)
->
join
(
"admin ad"
,
"r.admin_id= ad.id"
,
"LEFT"
)
->
where
(
$where
)
->
where
(
"ad.type=2"
)
->
field
(
'a.*,FROM_UNIXTIME(a.createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'r.createtime desc'
)
->
group
(
"a.id"
)
->
paginate
(
$pageSize
,
false
,[
'query'
=>
$param
]);
//echo self::getLastSql();
return
$list
;
}
/**
* 我的回复留言
*/
public
static
function
myReleaseReply
(
$where
,
$pageSize
=
10
,
$param
){
$list
=
self
::
alias
(
"a"
)
->
join
(
"release_reply r"
,
"r.release_id= a.id"
,
"LEFT"
)
->
where
(
$where
)
->
field
(
'a.*,FROM_UNIXTIME(a.createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'a.createtime desc'
)
->
group
(
"a.id"
)
->
paginate
(
$pageSize
,
false
,[
'query'
=>
$param
]);
//echo self::getLastSql();
return
$list
;
}
/**
* 我的回复留言
*/
public
static
function
myReleaseArticle
(
$where
,
$pageSize
=
10
,
$param
){
$list
=
self
::
where
(
$where
)
->
field
(
'*,FROM_UNIXTIME(createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'createtime desc'
)
->
paginate
(
$pageSize
,
false
,[
'query'
=>
$param
]);
return
$list
;
}
}
}
application/index/controller/Interactive.php
View file @
1b287906
...
@@ -54,14 +54,27 @@ class Interactive extends Backend
...
@@ -54,14 +54,27 @@ class Interactive extends Backend
*/
*/
public
function
interactdiscuss
()
public
function
interactdiscuss
()
{
{
$datatype
=
$this
->
request
->
param
(
"datatype"
,
1
);
$keywords
=
$this
->
request
->
param
(
"keywords"
);
$keywords
=
$this
->
request
->
param
(
"keywords"
);
$where
[
'is_delete'
]
=
0
;
$where
[
'is_delete'
]
=
0
;
$where2
[
'a.is_delete'
]
=
$where3
[
'a.is_delete'
]
=
$where4
[
'a.is_delete'
]
=
$where5
[
'is_delete'
]
=
0
;
if
(
!
empty
(
$keywords
)){
if
(
!
empty
(
$keywords
)){
$where
[
'content'
]
=
[
'like'
,
"%
$keywords
%"
];
$where
[
'content'
]
=
[
'like'
,
"%
$keywords
%"
];
$where2
[
'a.content'
]
=
$where3
[
'a.content'
]
=
$where4
[
'a.content'
]
=
$where5
[
'content'
]
=
[
'like'
,
"%
$keywords
%"
];
}
if
(
in_array
(
$datatype
,[
2
,
3
,
4
,
5
])
&&
$this
->
auth
){
$where2
[
'a.admin_id'
]
=
$where4
[
'r.admin_id'
]
=
$where5
[
'admin_id'
]
=
$this
->
auth
->
id
;
if
(
$datatype
==
2
){
$list
=
ReleaseArticleModel
::
awaitReleaseReply
(
$where2
,
10
,
$this
->
request
->
param
());
}
else
if
(
$datatype
==
3
){
$list
=
ReleaseArticleModel
::
teacherReleaseReply
(
$where3
,
10
,
$this
->
request
->
param
());
}
else
if
(
$datatype
==
4
){
$list
=
ReleaseArticleModel
::
myReleaseReply
(
$where4
,
10
,
$this
->
request
->
param
());
}
else
{
$list
=
ReleaseArticleModel
::
myReleaseArticle
(
$where5
,
10
,
$this
->
request
->
param
());
}
}
else
{
$list
=
ReleaseArticleModel
::
allReleaseArticle
(
$where
,
10
,
$this
->
request
->
param
());
}
}
$list
=
ReleaseArticleModel
::
where
(
$where
)
->
field
(
'*,FROM_UNIXTIME(createtime,"%Y-%m-%d %h:%i:%s") as createtime_text'
)
->
order
(
'createtime desc'
)
->
paginate
(
$this
->
pagesize
,
false
,[
'query'
=>
$this
->
request
->
param
()]);
foreach
(
$list
as
$key
=>
$val
){
foreach
(
$list
as
$key
=>
$val
){
$list
[
$key
][
'content'
]
=
mb_substr_content
(
$val
[
'content'
],
550
);
$list
[
$key
][
'content'
]
=
mb_substr_content
(
$val
[
'content'
],
550
);
$list
[
$key
][
'adminuser'
]
=
Db
::
name
(
"admin"
)
->
where
([
'id'
=>
$val
[
'admin_id'
]])
->
field
(
"username,nickname,avatar,type"
)
->
find
();
$list
[
$key
][
'adminuser'
]
=
Db
::
name
(
"admin"
)
->
where
([
'id'
=>
$val
[
'admin_id'
]])
->
field
(
"username,nickname,avatar,type"
)
->
find
();
...
@@ -86,6 +99,7 @@ class Interactive extends Backend
...
@@ -86,6 +99,7 @@ class Interactive extends Backend
}
}
$this
->
view
->
assign
(
"currenttotal"
,
$currenttotal
);
$this
->
view
->
assign
(
"currenttotal"
,
$currenttotal
);
$this
->
view
->
assign
(
"keywords"
,
$keywords
);
$this
->
view
->
assign
(
"keywords"
,
$keywords
);
$this
->
view
->
assign
(
"datatype"
,
$datatype
);
return
$this
->
view
->
fetch
(
"index/interactdiscuss"
);
return
$this
->
view
->
fetch
(
"index/interactdiscuss"
);
}
}
/*
/*
...
@@ -141,7 +155,7 @@ class Interactive extends Backend
...
@@ -141,7 +155,7 @@ class Interactive extends Backend
->
where
(
$map
)
->
where
(
$map
)
->
field
(
'r.*,FROM_UNIXTIME(r.createtime,"%Y-%m-%d %h:%i:%s") as createtime_text,a.username,a.nickname,a.avatar,a.type'
)
->
field
(
'r.*,FROM_UNIXTIME(r.createtime,"%Y-%m-%d %h:%i:%s") as createtime_text,a.username,a.nickname,a.avatar,a.type'
)
->
order
(
'r.createtime desc'
)
->
order
(
'r.createtime desc'
)
->
limit
(
$this
->
pagesize
)
->
limit
(
2
)
->
page
(
$page
)
->
page
(
$page
)
->
select
();
->
select
();
...
...
application/index/view/common/headnavs.html
View file @
1b287906
...
@@ -13,12 +13,16 @@
...
@@ -13,12 +13,16 @@
<!-- <li class="navitems"><a class="alink" href="/index.php/index/index/tsztindex">特色专题</a></li> -->
<!-- <li class="navitems"><a class="alink" href="/index.php/index/index/tsztindex">特色专题</a></li> -->
<!-- <li class="navitems"><a class="alink" href="javascript:;">教学团队</a></li> -->
<!-- <li class="navitems"><a class="alink" href="javascript:;">教学团队</a></li> -->
</ul>
</ul>
{if $admin==null}
<div
class=
"navrights"
>
<div
class=
"navrights"
>
{if $admin==null}
<a
class=
"linklogin"
href=
"/yCVjiDHwKq.php/index/login"
>
登录
</a>
<a
class=
"linklogin"
href=
"/yCVjiDHwKq.php/index/login"
>
登录
</a>
{/else}
<a
class=
"linklogin"
href=
"/yCVjiDHwKq.php/index/index"
>
后台管理
</a>
{/if}
<!-- <a class="langtaggle" href="javascript:;">EN 丨 CN</a> -->
<!-- <a class="langtaggle" href="javascript:;">EN 丨 CN</a> -->
</div>
</div>
{/if}
</div>
</div>
</div>
</div>
<!-- basenav end -->
<!-- basenav end -->
\ No newline at end of file
application/index/view/index/interactdiscuss.html
View file @
1b287906
This diff is collapsed.
Click to expand it.
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