Commit 416c3996 authored by zhuwei's avatar zhuwei

开盘广场-评论置顶

parent 1fa3d745
...@@ -137,6 +137,21 @@ class Square extends Basic ...@@ -137,6 +137,21 @@ class Square extends Basic
} }
} }
public function editCommenSort() {
$params = $this->params;
if (!isset($params['id']) or !isset($params['sort'])) {
return $this->response("101", "参数不全");
}
$res= $this->s_square->editCommenSort($params);
if ($res) {
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
} }
\ No newline at end of file
...@@ -237,6 +237,22 @@ class SquareService ...@@ -237,6 +237,22 @@ class SquareService
return [ 'data' => $res]; return [ 'data' => $res];
} }
public function editCommenSort($params)
{
$where_params['id'] = $params['id'];
//城市
if (!empty($params['sort'])) {
$update_params['sort'] = $params['sort'];
}
if(!$update_params){
return false;
}
$res = $this->m_coment->updateStatus($where_params, $update_params);
return $res;
}
public function getSquareCommentExtList($params){ public function getSquareCommentExtList($params){
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
......
...@@ -63,4 +63,12 @@ class BComment extends Model ...@@ -63,4 +63,12 @@ class BComment extends Model
return $result; return $result;
} }
public function updateStatus($where_params,$update_params)
{
$result = $this->where($where_params)->update($update_params);
// dump($this->getLastSql());exit;
// big_log($this->getLastSql());
return $result;
}
} }
...@@ -862,6 +862,7 @@ Route::group('broker', [ ...@@ -862,6 +862,7 @@ Route::group('broker', [
'getSquareCommentList' => [ 'api_broker/Square/getSquareCommentList', [ 'method' => 'GET|POST' ] ], 'getSquareCommentList' => [ 'api_broker/Square/getSquareCommentList', [ 'method' => 'GET|POST' ] ],
'getCommenInfo' => [ 'api_broker/Square/getCommenInfo', [ 'method' => 'GET|POST' ] ], 'getCommenInfo' => [ 'api_broker/Square/getCommenInfo', [ 'method' => 'GET|POST' ] ],
'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ], 'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ],
'editCommenSort' => [ 'api_broker/Square/editCommenSort', [ 'method' => 'GET|POST' ] ],
]); ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment