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
70e2d038
Commit
70e2d038
authored
Jun 14, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公告
parent
01e207c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
9 deletions
+43
-9
Feed.php
application/api_broker/controller/Feed.php
+1
-1
Notice.php
application/index/controller/Notice.php
+8
-8
PushFeed.php
application/model/PushFeed.php
+34
-0
No files found.
application/api_broker/controller/Feed.php
View file @
70e2d038
...
...
@@ -116,7 +116,7 @@ class Feed extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$push
=
new
PushFeed
();
$field
=
'id,create_time,house_title,click_num,content,type'
;
$field
=
'id,create_time,house_title,click_num,content,type
,title
'
;
if
(
empty
(
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
101
,
"Id is null!"
);
...
...
application/index/controller/Notice.php
View file @
70e2d038
...
...
@@ -33,7 +33,7 @@ class Notice extends Basic
*/
public
function
index
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'index'
);
//
return view('index');
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
...
...
@@ -55,12 +55,12 @@ class Notice extends Basic
$where
[
'title'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'title'
]
.
'%'
];
}
$field
=
'
id,title,content,create_ti
me'
;
$where
[
'status'
]
=
0
;
$where
[
'type'
]
=
1
;
$field
=
'
a.id,a.title,a.content,a.create_time,b.na
me'
;
$where
[
'
a.
status'
]
=
0
;
$where
[
'
a.
type'
]
=
1
;
$data
[
'list'
]
=
$this
->
m_push
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$data
[
'total'
]
=
$this
->
m_push
->
getTotal
(
$where
);
$data
[
'list'
]
=
$this
->
m_push
->
getList
Agent
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$data
[
'total'
]
=
$this
->
m_push
->
get
ListAgent
Total
(
$where
);
return
$this
->
response
(
200
,
""
,
$data
);
}
...
...
@@ -70,11 +70,11 @@ class Notice extends Basic
* @return \think\Response
*/
public
function
addNotice
()
{
if
(
!
empty
(
$this
->
params
[
'title'
]))
{
if
(
empty
(
$this
->
params
[
'title'
]))
{
return
$this
->
response
(
101
,
'标题为空!'
);
}
if
(
!
empty
(
$this
->
params
[
'content'
]))
{
if
(
empty
(
$this
->
params
[
'content'
]))
{
return
$this
->
response
(
101
,
'内容为空!'
);
}
...
...
application/model/PushFeed.php
View file @
70e2d038
...
...
@@ -49,4 +49,37 @@ class PushFeed extends BaseModel
->
order
(
$order
)
->
find
();
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.user_id = b.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* @param $params
* @return int|string
*/
public
function
getListAgentTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.user_id = b.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
}
\ 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