Commit b619f3dc authored by zhuwei's avatar zhuwei

delSquare

parent ec294cad
...@@ -152,6 +152,23 @@ class Square extends Basic ...@@ -152,6 +152,23 @@ class Square extends Basic
} }
} }
public function delSquare()
{
$params = $this->params;
if (!isset($params['id']) or !isset($params['type'])) {
return $this->response("101", "参数不全");
}
if (!is_numeric($params['id'])) {
return $this->response("101", "参数错误");
}
$result= $this->s_square->delSquare($params);
if($result){
return $this->response("200", "成功",$result);
}else{
return $this->response("200", "成功",$result);
}
}
......
...@@ -171,11 +171,22 @@ class SquareService ...@@ -171,11 +171,22 @@ class SquareService
return $res; return $res;
} }
public function delSquare($id) public function delSquare($params)
{ {
$where_params['id'] = $id; $where_params['id'] = $params['id'];
switch ($params['type']) {
case 0:
$update_params['is_del'] = 1;
$res = $this->m_coment->updateStatus($where_params,$update_params);
break;
case 1:
$update_params['is_del'] = 1;
$res = $this->m_coment_ext->updateStatus($where_params,$update_params);
break;
default:
$update_params['status'] = 1; $update_params['status'] = 1;
$res = $this->m_square->updateStatus($where_params,$update_params); $res = $this->m_square->updateStatus($where_params,$update_params);
}
return $res; return $res;
} }
......
...@@ -89,7 +89,7 @@ class Square extends Basic ...@@ -89,7 +89,7 @@ class Square extends Basic
if (!is_numeric($params['id'])) { if (!is_numeric($params['id'])) {
return $this->response("101", "参数错误"); return $this->response("101", "参数错误");
} }
$result= $this->s_square->delSquare($params['id']); $result= $this->s_square->delSquare($params);
if($result){ if($result){
return $this->response("200", "成功",$result); return $this->response("200", "成功",$result);
......
...@@ -46,5 +46,13 @@ class BCommentExt extends Model ...@@ -46,5 +46,13 @@ class BCommentExt 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;
}
} }
...@@ -866,6 +866,7 @@ Route::group('broker', [ ...@@ -866,6 +866,7 @@ Route::group('broker', [
'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ], 'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ],
'editCommenSort' => [ 'api_broker/Square/editCommenSort', [ 'method' => 'GET|POST' ] ], 'editCommenSort' => [ 'api_broker/Square/editCommenSort', [ 'method' => 'GET|POST' ] ],
'getDistrictLable' => [ 'api_broker/Square/getDistrictLable', [ 'method' => 'GET|POST' ] ], 'getDistrictLable' => [ 'api_broker/Square/getDistrictLable', [ 'method' => 'GET|POST' ] ],
'delSquare' => [ 'api_broker/Square/delSquare', [ 'method' => 'GET|POST' ] ],
'getAgentDistrictId' => [ 'api_broker/Broker/getAgentDistrictId', [ 'method' => 'GET|POST' ] ], 'getAgentDistrictId' => [ 'api_broker/Broker/getAgentDistrictId', [ '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