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
aab5cb67
authored
Dec 23, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
7bfc92f3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
8 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/NoticeController.php
app/Logic/SystemNoticeLogic.php
app/Model/BusinessNoticeModel.php
public/js/Message/MessageList.js
resources/views/message/businessNotice.blade.php
app/Http/Controllers/MessageApiController.php
View file @
aab5cb67
...
...
@@ -170,7 +170,7 @@ class MessageApiController extends Controller
$this
->
setJson
();
$data
=
$request
->
all
();
try
{
(
new
SystemNoticeLogic
())
->
del
BusinessNotice
(
$data
);
(
new
SystemNoticeLogic
())
->
top
BusinessNotice
(
$data
);
$this
->
Export
(
0
,
'操作成功'
);
}
catch
(
\Exception
$e
){
$this
->
Export
(
400
,
$e
->
getMessage
());
...
...
app/Http/Controllers/NoticeController.php
View file @
aab5cb67
...
...
@@ -34,6 +34,7 @@ class NoticeController extends Controller
{
$data
=
$request
->
all
();
try
{
$data
[
'show_status'
]
=
1
;
$returnData
=
(
new
SystemNoticeLogic
())
->
businessNoticeList
(
$data
);
return
$this
->
codeExport
(
0
,
'公告获取成功'
,
$returnData
);
}
catch
(
\Exception
$e
){
...
...
app/Logic/SystemNoticeLogic.php
View file @
aab5cb67
...
...
@@ -446,14 +446,14 @@ class SystemNoticeLogic
public
function
delBusinessNotice
(
$requestData
)
{
$idArr
=
explode
(
','
,
$requestData
[
'business_notice_id'
]);
(
new
BusinessNoticeModel
())
->
where
(
'business_notice_id'
,
$idArr
)
->
delete
();
(
new
BusinessNoticeModel
())
->
where
In
(
'business_notice_id'
,
$idArr
)
->
delete
();
return
[];
}
public
function
showBusinessNotice
(
$requestData
)
{
$idArr
=
explode
(
','
,
$requestData
[
'business_notice_id'
]);
(
new
BusinessNoticeModel
())
->
where
(
'business_notice_id'
,
$idArr
)
->
update
([
'show_status'
=>
$requestData
[
'show_status'
]]);
(
new
BusinessNoticeModel
())
->
where
In
(
'business_notice_id'
,
$idArr
)
->
update
([
'show_status'
=>
$requestData
[
'show_status'
]]);
return
[];
}
...
...
@@ -465,7 +465,7 @@ class SystemNoticeLogic
throw
new
\Exception
(
'当前全系统置顶已满5条,暂时无法置顶新公告,请先取消一条现有置顶 !'
);
}
}
(
new
BusinessNoticeModel
())
->
where
(
'business_notice_id'
,
$idArr
)
->
update
([
'top_status'
=>
$requestData
[
'top_status'
]]);
(
new
BusinessNoticeModel
())
->
where
In
(
'business_notice_id'
,
$idArr
)
->
update
([
'top_status'
=>
$requestData
[
'top_status'
]]);
return
[];
}
...
...
app/Model/BusinessNoticeModel.php
View file @
aab5cb67
...
...
@@ -23,8 +23,8 @@ class BusinessNoticeModel extends Model
//类型1最新补货,2最新入库,3优势货源,4个人消息
static
public
$typeCn
=
[
1
=>
'最新补货'
,
2
=>
'最新入库'
,
3
=>
'优势货源'
,
4
=>
'个人消息'
];
static
public
$showCn
=
[
0
=>
'显示'
,
1
=>
'隐藏'
];
static
public
$topCn
=
[
0
=>
'置顶'
,
1
=>
'非置顶'
];
static
public
$showCn
=
[
1
=>
'显示'
,
0
=>
'隐藏'
];
static
public
$topCn
=
[
1
=>
'置顶'
,
0
=>
'非置顶'
];
static
public
$sourceCn
=
[
0
=>
'系统生成'
,
1
=>
'手动新增'
];
...
...
@@ -45,6 +45,9 @@ class BusinessNoticeModel extends Model
case
'update_title'
:
case
'update_content'
:
$obj
=
$obj
->
where
(
$key
,
'like'
,
'%'
.
$val
.
'%'
);
break
;
case
'create_time'
:
list
(
$start
,
$end
)
=
explode
(
'~'
,
$val
);
$obj
=
$obj
->
where
(
$key
,
'>='
,
strtotime
(
$start
))
->
where
(
$key
,
'<='
,
strtotime
(
$end
)
+
86399
);
break
;
case
'create_time_begin'
:
$obj
=
$obj
->
where
(
'create_time'
,
'>'
,
strtotime
(
$val
));
break
;
case
'create_time_end'
:
...
...
public/js/Message/MessageList.js
View file @
aab5cb67
...
...
@@ -357,7 +357,7 @@ layui.use(['form', 'table', 'laydate', 'layedit'], function () {
offset
:
'250px'
,
move
:
false
},
function
(
i
)
{
Request
(
'/msgapi/topBusinessNotice'
,
'POST'
,
{
business_notice_id
:
data
.
business_notice_id
,
show
_status
:
data
.
top_status
==
1
?
0
:
1
},
function
(
res
)
{
Request
(
'/msgapi/topBusinessNotice'
,
'POST'
,
{
business_notice_id
:
data
.
business_notice_id
,
top
_status
:
data
.
top_status
==
1
?
0
:
1
},
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
layer
.
msg
(
'操作成功'
,
{
shift
:
0
,
time
:
2000
},
function
()
{
layer
.
closeAll
();
...
...
resources/views/message/businessNotice.blade.php
View file @
aab5cb67
...
...
@@ -55,7 +55,7 @@
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
创建时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"create_time
_begin
"
placeholder=
"请选择创建时间"
autocomplete=
"off"
class=
"layui-input"
id=
"create_time"
/>
<input
type=
"text"
name=
"create_time"
placeholder=
"请选择创建时间"
autocomplete=
"off"
class=
"layui-input"
id=
"create_time"
/>
</div>
</div>
<div
class=
"layui-inline"
>
...
...
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