Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
5d1b903b
Commit
5d1b903b
authored
Jul 03, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app 商学院接口
parent
6b5e5817
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
3 deletions
+105
-3
News.php
application/api_broker/controller/News.php
+102
-0
route.php
application/route.php
+3
-3
No files found.
application/api_broker/controller/News.php
0 → 100644
View file @
5d1b903b
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/6/12
* Time: 17:21
*/
namespace
app\api_broker\controller
;
use
app\index\extend\Basic
;
use
app\model\SLabel
;
use
app\model\SNews
;
use
think\Request
;
class
News
extends
Basic
{
protected
$m_news
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
m_news
=
new
SNews
();
}
/**
* 商学院列表
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'index'
);
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$this
->
params
[
'title'
]))
{
$where
[
'a.title'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'title'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'label_id'
]))
{
$where
[
'a.s_label_id'
]
=
$this
->
params
[
'label_id'
];
}
$field
=
'a.id,a.title,a.content,a.create_time,b.name,c.label_name'
;
$where
[
'a.status'
]
=
0
;
$data
[
'list'
]
=
$this
->
m_news
->
getListAgent
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$data
[
'total'
]
=
$this
->
m_news
->
getListAgentTotal
(
$where
);
return
$this
->
response
(
200
,
""
,
$data
);
}
/**
* 商学院资讯详情
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getNewsInfo
()
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
101
,
"Id is null."
);
}
$data
=
$this
->
m_news
->
getNewsInfo
(
'id,title,s_label_id,cover_plan,content'
);
return
$this
->
response
(
200
,
""
,
$data
);
}
/**
* 商学院标签
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getNewsLabel
()
{
$label
=
new
SLabel
();
$data
=
$label
->
getList
(
1
,
200
,
''
,
'id,label_name'
,
[
'status'
=>
0
]);
return
$this
->
response
(
200
,
''
,
$data
);
}
}
\ No newline at end of file
application/route.php
View file @
5d1b903b
...
@@ -488,10 +488,10 @@ Route::group('broker', [
...
@@ -488,10 +488,10 @@ Route::group('broker', [
'superviseListNew'
=>
[
'api_broker/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行列表 朱伟 2018-06-15
'superviseListNew'
=>
[
'api_broker/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行列表 朱伟 2018-06-15
'addSupervise'
=>
[
'api_broker/Supervise/addSupervise'
,
[
'method'
=>
'POST|GET'
]
],
//新增-监督执行 朱伟 2018-06-20
'addSupervise'
=>
[
'api_broker/Supervise/addSupervise'
,
[
'method'
=>
'POST|GET'
]
],
//新增-监督执行 朱伟 2018-06-20
'superviseUploadImg'
=>
[
'api_broker/Supervise/superviseUploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行-上传图片 朱伟 2018-06-20
'superviseUploadImg'
=>
[
'api_broker/Supervise/superviseUploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行-上传图片 朱伟 2018-06-20
'uploadImg'
=>
[
'api_broker/UploadImg/uploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//图片上传
'uploadImg'
=>
[
'api_broker/UploadImg/uploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//图片上传
'business_school'
=>
[
'api_broker/news/index'
,
[
'method'
=>
'GET'
]
],
//商学院资讯列表
'getNewsInfo'
=>
[
'api_broker/news/getNewsInfo'
,
[
'method'
=>
'GET'
]
],
//商学院资讯详情
'getNewsLabel'
=>
[
'api_broker/news/getNewsLabel'
,
[
'method'
=>
'GET'
]
],
//商学院资标签
]);
]);
...
...
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