Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ed8d625f
authored
Dec 22, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
40563cb3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
232 additions
and
0 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/NoticeController.php
app/Http/routes.php
app/Logic/CommonLogic.php
app/Logic/SystemNoticeLogic.php
app/Model/BusinessNoticeModel.php
app/Http/Controllers/MessageApiController.php
View file @
ed8d625f
...
...
@@ -102,6 +102,69 @@ class MessageApiController extends Controller
}
}
private
function
businessNoticeList
(
$request
)
{
$data
=
$request
->
all
();
try
{
$returnData
=
(
new
SystemNoticeLogic
())
->
businessNoticeList
(
$data
);
echo
json_encode
([
'code'
=>
0
,
'count'
=>
$returnData
[
'total'
],
'data'
=>
$returnData
[
'data'
],
'msg'
=>
'获取成功'
]);
exit
();
}
catch
(
\Exception
$e
){
echo
json_encode
([
'code'
=>
1
,
'msg'
=>
$e
->
getMessage
()]);
exit
();
}
}
//保存系统更新信息
private
function
saveBusinessNotice
(
$request
)
{
$data
=
$request
->
all
();
try
{
(
new
SystemNoticeLogic
())
->
saveBusinessNotice
(
$data
);
$this
->
Export
(
0
,
'操作成功'
);
}
catch
(
\Exception
$e
){
$this
->
Export
(
400
,
$e
->
getMessage
());
}
}
private
function
showBusinessNotice
(
$request
)
{
$data
=
$request
->
all
();
try
{
(
new
SystemNoticeLogic
())
->
showBusinessNotice
(
$data
);
$this
->
Export
(
0
,
'操作成功'
);
}
catch
(
\Exception
$e
){
$this
->
Export
(
400
,
$e
->
getMessage
());
}
}
private
function
delBusinessNotice
(
$request
)
{
$data
=
$request
->
all
();
try
{
(
new
SystemNoticeLogic
())
->
delBusinessNotice
(
$data
);
$this
->
Export
(
0
,
'操作成功'
);
}
catch
(
\Exception
$e
){
$this
->
Export
(
400
,
$e
->
getMessage
());
}
}
private
function
topBusinessNotice
(
$request
)
{
$data
=
$request
->
all
();
try
{
(
new
SystemNoticeLogic
())
->
delBusinessNotice
(
$data
);
$this
->
Export
(
0
,
'操作成功'
);
}
catch
(
\Exception
$e
){
$this
->
Export
(
400
,
$e
->
getMessage
());
}
}
//保存系统宣讲信息
private
function
saveSystemPreach
(
$request
)
{
...
...
app/Http/Controllers/NoticeController.php
View file @
ed8d625f
...
...
@@ -30,6 +30,29 @@ class NoticeController extends Controller
}
public
function
businessNoticeList
(
Request
$request
)
{
$data
=
$request
->
all
();
try
{
$returnData
=
(
new
SystemNoticeLogic
())
->
businessNoticeList
(
$data
);
$this
->
codeExport
(
0
,
'公告获取成功'
,
$returnData
);
}
catch
(
\Exception
$e
){
$this
->
codeExport
(
1
,
$e
->
getMessage
());
}
}
public
function
saveBusinessNotice
(
Request
$request
)
{
$data
=
$request
->
all
();
try
{
$returnData
=
(
new
SystemNoticeLogic
())
->
saveBusinessNotice
(
$data
);
$this
->
codeExport
(
0
,
'保存成功'
,
$returnData
);
}
catch
(
\Exception
$e
){
$this
->
codeExport
(
1
,
$e
->
getMessage
());
}
}
...
...
@@ -38,4 +61,9 @@ class NoticeController extends Controller
echo
json_encode
([
'errcode'
=>
$errcode
,
'errmsg'
=>
$errmsg
,
'data'
=>
$data
]);
exit
();
}
private
function
codeExport
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
echo
json_encode
([
'code'
=>
$errcode
,
'msg'
=>
$errmsg
,
'data'
=>
$data
]);
exit
();
}
}
\ No newline at end of file
app/Http/routes.php
View file @
ed8d625f
...
...
@@ -84,6 +84,12 @@ Route::resource('batchapi', 'BatchapiController');
Route
::
get
(
'/notice/getNotice'
,
'NoticeController@getNotice'
);
Route
::
get
(
'/sync/businessNoticeList'
,
'NoticeController@businessNoticeList'
);
Route
::
get
(
'/sync/saveBusinessNotice'
,
'NoticeController@saveBusinessNotice'
);
Route
::
group
([
'middleware'
=>
'webapi'
],
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/webapi/{key}'
,
'WebApiController@Entrance'
);
});
\ No newline at end of file
app/Logic/CommonLogic.php
0 → 100644
View file @
ed8d625f
<?php
namespace
App\Logic
;
class
CommonLogic
{
}
\ No newline at end of file
app/Logic/SystemNoticeLogic.php
View file @
ed8d625f
...
...
@@ -10,6 +10,7 @@ namespace App\Logic;
//系统通知逻辑层
use
App\Console\Commands\CreateNotice
;
use
App\Model\BusinessNoticeModel
;
use
App\Model\SystemBulletinModel
;
use
App\Model\SystemPreachModel
;
use
App\Model\SystemUpdateModel
;
...
...
@@ -387,4 +388,75 @@ class SystemNoticeLogic
}
}
public
function
businessNoticeList
(
$where
)
{
$obj
=
(
new
BusinessNoticeModel
())
->
getWhereObj
(
$where
);
$returnData
=
$obj
->
paginate
(
$where
[
'limit'
])
->
toArray
();
if
(
empty
(
$returnData
[
'data'
])){
throw
new
\Exception
(
'暂无数据'
);
}
foreach
(
$returnData
[
'data'
]
as
&
$value
){
$value
[
'create_time_cn'
]
=
date
(
'Y-m-d H:i:s'
,
$value
[
'create_time'
]);
$value
[
'system_id_cn'
]
=
''
;
$value
[
'type_cn'
]
=
''
;
$value
[
'show_status_cn'
]
=
''
;
$value
[
'top_status_cn'
]
=
''
;
$value
[
'source_cn'
]
=
''
;
}
return
$returnData
;
}
public
function
saveBusinessNotice
(
$requestData
)
{
return
[];
}
public
function
delBusinessNotice
(
$requestData
)
{
return
[];
}
public
function
showBusinessNotice
(
$requestData
)
{
return
[];
}
public
function
topBusinessNotice
(
$requestData
)
{
return
[];
}
}
\ No newline at end of file
app/Model/BusinessNoticeModel.php
0 → 100644
View file @
ed8d625f
<?php
/**
* Created by 2022/12/2.
* User: Jone
* Info: 2022/12/2
* Time: 上午10:27
*/
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
BusinessNoticeModel
extends
Model
{
protected
$connection
=
'messagemodel'
;
protected
$table
=
'business_notice'
;
protected
$primaryKey
=
'business_notice_id'
;
public
$timestamps
=
false
;
public
function
getWhereObj
(
$data
)
{
$obj
=
self
::
orderBy
(
'business_notice_id'
,
'desc'
);
foreach
(
$data
as
$key
=>
$val
){
if
(
$val
===
''
)
continue
;
switch
(
$key
){
case
'system_name'
:
case
'update_type'
:
case
'version_num'
:
case
'weonlt_id'
:
case
'product_user'
:
$obj
=
$obj
->
where
(
$key
,
$val
);
break
;
case
'smue_id_str'
:
$obj
=
$obj
->
whereIn
(
'smue_id'
,
explode
(
','
,
$val
));
break
;
case
'update_title'
:
case
'update_content'
:
$obj
=
$obj
->
where
(
$key
,
'like'
,
'%'
.
$val
.
'%'
);
break
;
case
'begin_time'
:
$obj
=
$obj
->
where
(
'create_time'
,
'>'
,
strtotime
(
$val
));
break
;
case
'end_time'
:
$obj
=
$obj
->
where
(
'create_time'
,
'<='
,
strtotime
(
$val
));
break
;
}
}
return
$obj
;
}
}
\ No newline at end of file
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