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
aa8d88d9
Commit
aa8d88d9
authored
Apr 02, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
肥家
parent
c8cfcf0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
2 deletions
+78
-2
Square.php
application/api_broker/controller/Square.php
+17
-0
SquareService.php
application/api_broker/service/SquareService.php
+61
-2
No files found.
application/api_broker/controller/Square.php
View file @
aa8d88d9
...
...
@@ -59,6 +59,23 @@ class Square extends Basic
}
}
public
function
addcoment
()
{
$params
=
$this
->
params
;
if
(
!
$params
)
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
addcoment
(
$params
);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
...
...
application/api_broker/service/SquareService.php
View file @
aa8d88d9
...
...
@@ -2,15 +2,21 @@
namespace
app\api_broker\service
;
use
app\model\BComment
;
use
app\model\BCommentExt
;
use
app\model\BSquare
;
class
SquareService
{
private
$m_square
;
private
$m_coment
;
private
$m_coment_ext
;
public
function
__construct
()
{
$this
->
m_square
=
new
BSquare
();
$this
->
m_coment
=
new
BComment
();
$this
->
m_coment_ext
=
new
BCommentExt
();
}
public
function
saveSquare
(
$agent_id
,
$title
,
$content
,
$cover_img
,
$site_id
,
$district_id
)
...
...
@@ -32,8 +38,8 @@ class SquareService
}
public
function
getSquareList
(
$params
){
$pageNo
=
empty
(
$params
[
'page
No'
])
?
1
:
$params
[
'pageN
o'
];
$pageSize
=
empty
(
$params
[
'page
Size'
])
?
15
:
$params
[
'pageS
ize'
];
$pageNo
=
empty
(
$params
[
'page
_no'
])
?
1
:
$params
[
'page_n
o'
];
$pageSize
=
empty
(
$params
[
'page
_size'
])
?
15
:
$params
[
'page_s
ize'
];
//搜索 时间
if
(
!
empty
(
$params
[
'start_date'
])
&&
empty
(
$params
[
'end_date'
]))
{
...
...
@@ -133,4 +139,56 @@ class SquareService
$res
=
$this
->
m_square
->
updateStatus
(
$where_params
,
$update_params
);
return
$res
;
}
public
function
addcoment
(
$params
)
{
if
(
isset
(
$params
[
'level'
]))
{
$this
->
addBCommentExt
(
$params
);
}
else
{
$this
->
addBComent
(
$params
);
}
}
public
function
addBComent
(
$params
)
{
// `square_id` int(10) DEFAULT '0' COMMENT '文章id',
// `comment` varchar(255) DEFAULT '' COMMENT '评价内容',
// `agent_id` int(10) DEFAULT '0' COMMENT '评论人',
// `sort` int(5) DEFAULT '0' COMMENT '排序 0没排序 大于0表示置顶数值越大排行越高',
// `sort_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '置顶时间',
// `is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除 0正常 1删除',
$insert
[
"square_id"
]
=
$params
[
"square_id"
];
//文章id
$insert
[
"comment"
]
=
$params
[
"comment"
];
//评价内容
$insert
[
"agent_id"
]
=
$params
[
"agent_id"
];
//评论人
$insert
[
"sort"
]
=
$params
[
"sort"
];
//排序 0没排序 大于0表示置顶数值越大排行越高
// $insert["sort_time"] = $params["sort_time"];//置顶时间s
$insert
[
"is_del"
]
=
0
;
//是否删除 0正常 1删除
$res
=
$this
->
m_coment
->
saveComment
(
$insert
);
//int(1)
if
(
$res
==
1
){
return
true
;
}
else
{
return
false
;
}
}
public
function
addBCommentExt
(
$params
)
{
$insert
[
"comment_id"
]
=
$params
[
"comment_id"
];
//comment_id
$insert
[
"agent_id_a"
]
=
$params
[
"agent_id_a"
];
//经纪人a 回复人
$insert
[
"agent_id_b"
]
=
$params
[
"agent_id_b"
];
//经纪人b被回复人
$insert
[
"comment"
]
=
$params
[
"comment_id"
];
//回复内容
$insert
[
"level"
]
=
$params
[
'level'
];
//评论级别 1直接评论 2回复评论
$insert
[
"is_del"
]
=
0
;
//是否删除 0正常 1删除
$res
=
$this
->
m_coment_ext
->
saveCommentExt
(
$insert
);
//int(1)
if
(
$res
==
1
){
return
true
;
}
else
{
return
false
;
}
}
}
\ 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