Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ruer_cms
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
蔡闯
ruer_cms
Commits
933cdfda
Commit
933cdfda
authored
Jul 06, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2021-7-6
parent
03be9962
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
app/admin/controller/Message.php
app/admin/controller/Message.php
+13
-1
app/wechatapi/controller/Company.php
app/wechatapi/controller/Company.php
+25
-0
config/middleware.php
config/middleware.php
+4
-1
No files found.
app/admin/controller/Message.php
View file @
933cdfda
...
...
@@ -4,6 +4,7 @@
namespace
app\admin\controller
;
use
think\facade\Cache
;
use
think\facade\Request
;
use
think\facade\Db
;
...
...
@@ -44,11 +45,22 @@ class Message extends Base
}
$count
=
Db
::
name
(
'message'
)
->
count
();
$res
[
'total'
]
=
$count
;
$redis
=
Cache
::
store
(
'redis'
)
->
handler
();
$read_num
=
$redis
->
get
(
"ruer_zhaoshang_read_num"
);
if
(
!
$read_num
)
{
$read_num
=
0
;
}
$forward_num
=
$redis
->
get
(
"ruer_zhaoshang_forward_num"
);
if
(
!
$forward_num
)
{
$forward_num
=
0
;
}
$statistics
[
'read_num'
]
=
$read_num
;
$statistics
[
'forward_num'
]
=
$forward_num
;
$res
[
'statistics'
]
=
$statistics
;
$res
[
'data'
]
=
changeField
(
$list
);
return
$this
->
returnJson
(
$res
,
'success'
);
}
//意见反馈详情
public
function
messageDetail
(){
$id
=
Request
::
param
(
'message_id'
);
...
...
app/wechatapi/controller/Company.php
View file @
933cdfda
<?php
namespace
app\wechatapi\controller
;
use
app\BaseController
;
use
think\facade\Cache
;
use
think\facade\Db
;
use
think\facade\Request
;
...
...
@@ -38,6 +39,15 @@ class Company extends BaseController
public
function
getBusInfo
()
{
$res
=
Db
::
name
(
'bus'
)
->
where
([
'id'
=>
1
])
->
find
();
//redis统计阅读量
$key
=
"ruer_zhaoshang_read_num"
;
$redis
=
Cache
::
store
(
'redis'
)
->
handler
();
$read_num
=
$redis
->
get
(
$key
);
if
(
$read_num
)
{
$redis
->
incr
(
$key
);
}
else
{
$redis
->
set
(
$key
,
1
);
}
if
(
$res
[
'content'
])
{
$res
[
'content'
]
=
json_decode
(
$res
[
'content'
],
true
);
}
else
{
...
...
@@ -67,6 +77,21 @@ class Company extends BaseController
return
$this
->
returnJson
(
$result
);
}
//转发加1
public
function
censusForwardNum
()
{
$key
=
"ruer_zhaoshang_forward_num"
;
$redis
=
Cache
::
store
(
'redis'
)
->
handler
();
$read_num
=
$redis
->
get
(
$key
);
if
(
$read_num
)
{
$redis
->
incr
(
$key
);
}
else
{
$redis
->
set
(
$key
,
1
);
}
}
}
config/middleware.php
View file @
933cdfda
...
...
@@ -2,7 +2,10 @@
// 中间件配置
return
[
// 别名或分组
'alias'
=>
[],
'alias'
=>
[
],
// 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
'priority'
=>
[],
];
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