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
2e86f9f6
Commit
2e86f9f6
authored
Apr 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getSquareInfo
parent
be41f417
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
11 deletions
+117
-11
Square.php
application/api_broker/controller/Square.php
+18
-3
SquareService.php
application/api_broker/service/SquareService.php
+33
-3
BComment.php
application/model/BComment.php
+29
-0
BCommentExt.php
application/model/BCommentExt.php
+29
-0
BSquare.php
application/model/BSquare.php
+3
-2
route.php
application/route.php
+5
-3
No files found.
application/api_broker/controller/Square.php
View file @
2e86f9f6
...
@@ -42,6 +42,21 @@ class Square extends Basic
...
@@ -42,6 +42,21 @@ class Square extends Basic
}
}
}
}
public
function
getSquareCommentList
()
{
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'square_id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
getSquareCommentList
(
$params
);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
public
function
getSquareInfo
(){
public
function
getSquareInfo
(){
...
@@ -59,7 +74,7 @@ class Square extends Basic
...
@@ -59,7 +74,7 @@ class Square extends Basic
}
}
}
}
public
function
add
c
oment
()
public
function
add
C
oment
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
...
@@ -73,10 +88,10 @@ class Square extends Basic
...
@@ -73,10 +88,10 @@ class Square extends Basic
}
}
$result
=
$this
->
s_square
->
addBCommentExt
(
$params
[
'comment_id'
],
$params
[
'agent_id_a'
],
$params
[
'agent_id_b'
],
$params
[
'comment'
],
$params
[
'level'
]);
$result
=
$this
->
s_square
->
addBCommentExt
(
$params
[
'comment_id'
],
$params
[
'agent_id_a'
],
$params
[
'agent_id_b'
],
$params
[
'comment'
],
$params
[
'level'
]);
}
else
{
}
else
{
if
(
!
isset
(
$params
[
'
title'
])
or
!
isset
(
$params
[
'square_id'
])
or
!
isset
(
$params
[
'comment'
])
or
!
isset
(
$params
[
'agent_id
'
]))
{
if
(
!
isset
(
$params
[
'
square_id'
])
or
!
isset
(
$params
[
'square_id'
])
or
!
isset
(
$params
[
'comment
'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
return
$this
->
response
(
"101"
,
"参数不全"
);
}
}
$result
=
$this
->
s_square
->
addBComent
(
$params
[
'square_id'
],
$params
[
'comment'
],
$
params
[
'agent_id'
]
);
$result
=
$this
->
s_square
->
addBComent
(
$params
[
'square_id'
],
$params
[
'comment'
],
$
this
->
agentId
);
}
}
if
(
$result
){
if
(
$result
){
...
...
application/api_broker/service/SquareService.php
View file @
2e86f9f6
...
@@ -79,6 +79,36 @@ class SquareService
...
@@ -79,6 +79,36 @@ class SquareService
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
}
}
public
function
getSquareCommentList
(
$params
){
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$field
=
'Comment.id,'
;
//
$field
.=
'Comment.comment,'
;
//
$field
.=
'Comment.sort,'
;
//
$field
.=
'Comment.create_time,'
;
//
$field
.=
'Agent.name,'
;
//
$field
.=
'Agent.img'
;
//
$get_params
[
'Comment.square_id'
]
=
$params
[
'square_id'
];
$res
=
$this
->
m_coment
->
getSquareCommentList
(
$pageNo
,
$pageSize
,
$field
,
$get_params
);
$res_total
=
$this
->
m_coment
->
getSquareCommentListTotal
(
$field
,
$get_params
);
foreach
(
$res
as
$key
=>
$val
)
{
$res
[
$key
][
'img'
]
=
'http://n.sinaimg.cn/ent/transform/20170921/FVGl-fymesmp0851702.jpg'
;
$field
=
'CommentExt.id,'
;
//
$field
.=
'CommentExt.comment,'
;
//
$field
.=
'Agent.name,'
;
//
$field
.=
'Agent.img'
;
//
$get_params
[
'CommentExt.comment_id'
]
=
$val
[
'id'
];
$res
=
$this
->
m_coment_ext
->
getSquareCommentExtList
(
1
,
2
,
$field
,
$get_params
);
$res
[
$key
][
'comment_ext'
]
=
'http://n.sinaimg.cn/ent/transform/20170921/FVGl-fymesmp0851702.jpg'
;
}
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
}
public
function
getSquareInfo
(
$params
){
public
function
getSquareInfo
(
$params
){
...
@@ -86,12 +116,12 @@ class SquareService
...
@@ -86,12 +116,12 @@ class SquareService
$field
.=
'Square.title,'
;
//标题
$field
.=
'Square.title,'
;
//标题
$field
.=
'Square.content,'
;
//标题
$field
.=
'Square.content,'
;
//标题
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'S
ite.name as site_name
,'
;
//城市
$field
.=
'S
quare.site_id
,'
;
//城市
$field
.=
'
District.district_name
,'
;
//部门
$field
.=
'
Square.district_id
,'
;
//部门
$field
.=
'Square.create_time'
;
//发布时间
$field
.=
'Square.create_time'
;
//发布时间
$get_params
[
'Square.id'
]
=
$params
[
'id'
];
$get_params
[
'Square.id'
]
=
$params
[
'id'
];
$get_params
[
'Square.status'
]
=
0
;
//
$get_params['Square.status'] = 0;
$res
=
$this
->
m_square
->
getSquareInfo
(
$field
,
$get_params
);
$res
=
$this
->
m_square
->
getSquareInfo
(
$field
,
$get_params
);
...
...
application/model/BComment.php
View file @
2e86f9f6
...
@@ -19,5 +19,34 @@ class BComment extends Model
...
@@ -19,5 +19,34 @@ class BComment extends Model
return
$this
->
insert
(
$data
);
return
$this
->
insert
(
$data
);
}
}
public
function
getSquareCommentList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
$order
=
"Comment.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'Comment'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Comment.agent_id'
,
'right'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
public
function
getSquareCommentListTotal
(
$field
,
$params
)
{
$order
=
"Comment.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'Comment'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Comment.agent_id'
,
'right'
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
}
}
application/model/BCommentExt.php
View file @
2e86f9f6
...
@@ -19,5 +19,34 @@ class BCommentExt extends Model
...
@@ -19,5 +19,34 @@ class BCommentExt extends Model
return
$this
->
insert
(
$data
);
return
$this
->
insert
(
$data
);
}
}
public
function
getSquareCommentExtList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
$order
=
"CommentExt.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'CommentExt'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Comment.agent_id'
,
'right'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
public
function
getSquareCommentExtListTotal
(
$field
,
$params
)
{
$order
=
"CommentExt.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'CommentExt'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Comment.agent_id'
,
'right'
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
}
}
application/model/BSquare.php
View file @
2e86f9f6
...
@@ -53,6 +53,7 @@ class BSquare extends Model
...
@@ -53,6 +53,7 @@ class BSquare extends Model
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
// ->join('b_comment Comment', 'Square.id = Comment.square_id', 'right')
->
where
(
$params
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
...
@@ -71,7 +72,7 @@ class BSquare extends Model
...
@@ -71,7 +72,7 @@ class BSquare extends Model
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
// ->join('b_comment Comment', 'Square.id = Comment.square_id', 'right')
->
where
(
$params
)
->
where
(
$params
)
->
count
();
->
count
();
//dump($this->getLastSql());
//dump($this->getLastSql());
...
@@ -90,7 +91,7 @@ class BSquare extends Model
...
@@ -90,7 +91,7 @@ class BSquare extends Model
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order
)
->
order
(
$order
)
->
find
();
->
find
();
//dump($this->getLastSql());
//
dump($this->getLastSql());
return
$result
;
return
$result
;
}
}
...
...
application/route.php
View file @
2e86f9f6
...
@@ -854,9 +854,11 @@ Route::group('broker', [
...
@@ -854,9 +854,11 @@ Route::group('broker', [
'getStoreRandKingListByAgentId'
=>
[
'api_broker/RankingList/getStoreRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
'getStoreRandKingListByAgentId'
=>
[
'api_broker/RankingList/getStoreRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
//开盘广场
//开盘广场
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]
],
'getSquareList'
=>
[
'api_broker/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'api_broker/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]
],
'getSquareInfo'
=>
[
'api_broker/Square/getSquareInfo'
,
[
'method'
=>
'GET|POST'
]],
'getSquareInfo'
=>
[
'api_broker/Square/getSquareInfo'
,
[
'method'
=>
'GET|POST'
]
],
'addComent'
=>
[
'api_broker/Square/addComent'
,
[
'method'
=>
'GET|POST'
]
],
'getSquareCommentList'
=>
[
'api_broker/Square/getSquareCommentList'
,
[
'method'
=>
'GET|POST'
]
],
]);
]);
...
...
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