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
19505988
authored
Dec 23, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
b5af9458
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
app/Http/Controllers/NoticeController.php
app/Model/BusinessNoticeModel.php
app/Http/Controllers/NoticeController.php
View file @
19505988
...
@@ -63,6 +63,13 @@ class NoticeController extends Controller
...
@@ -63,6 +63,13 @@ class NoticeController extends Controller
}
}
private
function
codeExport
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
private
function
codeExport
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
return
response
()
->
json
([
'code'
=>
$errcode
,
'msg'
=>
$errmsg
,
'data'
=>
$data
]);
return
response
()
->
json
([
'code'
=>
$errcode
,
'msg'
=>
$errmsg
,
'data'
=>
$data
])
// 允许的源(生产环境替换为你的前端域名,如 https://www.example.com)
->
header
(
'Access-Control-Allow-Origin'
,
'*'
)
// 允许的请求方法
->
header
(
'Access-Control-Allow-Methods'
,
'GET, POST, PUT, DELETE, OPTIONS'
)
// 允许的请求头(包含前端常用的 Token/Content-Type 等)
->
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Authorization, X-Requested-With'
)
// 允许前端携带 Cookie(如需跨域传 Cookie 则添加)
->
header
(
'Access-Control-Allow-Credentials'
,
'true'
);
}
}
}
}
\ No newline at end of file
app/Model/BusinessNoticeModel.php
View file @
19505988
...
@@ -30,7 +30,7 @@ class BusinessNoticeModel extends Model
...
@@ -30,7 +30,7 @@ class BusinessNoticeModel extends Model
public
function
getWhereObj
(
$data
)
public
function
getWhereObj
(
$data
)
{
{
$obj
=
self
::
orderBy
(
'business_notice_id'
,
'desc'
);
$obj
=
self
::
orderBy
(
'
top_status'
,
'desc'
)
->
orderBy
(
'
business_notice_id'
,
'desc'
);
foreach
(
$data
as
$key
=>
$val
){
foreach
(
$data
as
$key
=>
$val
){
if
(
$val
===
''
)
continue
;
if
(
$val
===
''
)
continue
;
switch
(
$key
){
switch
(
$key
){
...
...
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