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
a5ef3cd0
Commit
a5ef3cd0
authored
Apr 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
fce1e7d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
32 deletions
+27
-32
Square.php
application/api_broker/controller/Square.php
+11
-1
SquareService.php
application/api_broker/service/SquareService.php
+13
-28
Square.php
application/index/controller/Square.php
+3
-3
No files found.
application/api_broker/controller/Square.php
View file @
a5ef3cd0
...
...
@@ -67,7 +67,17 @@ class Square extends Basic
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
addcoment
(
$params
);
if
(
isset
(
$params
[
'level'
]))
{
if
(
!
isset
(
$params
[
'comment_id'
])
or
!
isset
(
$params
[
'agent_id_a'
])
or
!
isset
(
$params
[
'agent_id_b'
])
or
!
isset
(
$params
[
'comment'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
addBCommentExt
(
$params
[
'comment_id'
],
$params
[
'agent_id_a'
],
$params
[
'agent_id_b'
],
$params
[
'comment'
],
$params
[
'level'
]);
}
else
{
if
(
!
isset
(
$params
[
'title'
])
or
!
isset
(
$params
[
'square_id'
])
or
!
isset
(
$params
[
'comment'
])
or
!
isset
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
addBComent
(
$params
[
'square_id'
],
$params
[
'comment'
],
$params
[
'agent_id'
]);
}
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
...
...
application/api_broker/service/SquareService.php
View file @
a5ef3cd0
...
...
@@ -140,30 +140,16 @@ class SquareService
return
$res
;
}
public
function
addcoment
(
$params
)
{
if
(
isset
(
$params
[
'level'
]))
{
$this
->
addBCommentExt
(
$params
);
}
else
{
$this
->
addBComent
(
$params
);
}
}
public
function
addBComent
(
$
params
)
public
function
addBComent
(
$
square_id
,
$comment
,
$agent_id
)
{
// `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
[
"square_id"
]
=
$square_id
;
//文章id
$insert
[
"comment"
]
=
$comment
;
//评价内容
$insert
[
"agent_id"
]
=
$agent_id
;
//评论人
$insert
[
"sort"
]
=
0
;
//排序 0没排序 大于0表示置顶数值越大排行越高
$insert
[
"is_del"
]
=
0
;
//是否删除 0正常 1删除
// $insert["sort_time"] = $params["sort_time"];//置顶时间s
$insert
[
"is_del"
]
=
0
;
//是否删除 0正常 1删除
$res
=
$this
->
m_coment
->
saveComment
(
$insert
);
//int(1)
if
(
$res
==
1
){
...
...
@@ -173,15 +159,14 @@ class SquareService
}
}
public
function
addBCommentExt
(
$
params
)
public
function
addBCommentExt
(
$
comment_id
,
$agent_id_a
,
$agent_id_b
,
$comment
,
$level
)
{
$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删除
$insert
[
"comment_id"
]
=
$comment_id
;
//comment_id
$insert
[
"agent_id_a"
]
=
$agent_id_a
;
//经纪人a 回复人
$insert
[
"agent_id_b"
]
=
$agent_id_b
;
//经纪人b被回复人
$insert
[
"comment"
]
=
$comment
;
//回复内容
$insert
[
"level"
]
=
$level
;
//评论级别 1直接评论 2回复评论
$insert
[
"is_del"
]
=
0
;
//是否删除 0正常 1删除
$res
=
$this
->
m_coment_ext
->
saveCommentExt
(
$insert
);
//int(1)
if
(
$res
==
1
){
...
...
application/index/controller/Square.php
View file @
a5ef3cd0
...
...
@@ -42,9 +42,9 @@ class Square extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'title'
])
or
!
isset
(
$params
[
'content'
])
or
!
isset
(
$params
[
'site_id'
])
or
!
isset
(
$params
[
'cover_img'
])
or
!
isset
(
$params
[
'district_id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
//
if (!isset($params['title']) or !isset($params['content']) or !isset($params['site_id']) or !isset($params['cover_img']) or !isset($params['district_id'])) {
//
return $this->response("101", "参数不全");
//
}
$result
=
$this
->
s_square
->
getSquareList
(
$params
);
...
...
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