Commit 19505988 by gongyang

提交代码

parent b5af9458
...@@ -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
...@@ -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){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment