Commit f5cc1a46 authored by zhuwei's avatar zhuwei

开盘广场-编辑

parent 84830494
......@@ -103,4 +103,34 @@ class SquareService
$res = $this->m_square->updateStatus($where_params,$update_params);
return $res;
}
public function editSquare($params)
{
$where_params['id'] = $params['id'];
//城市
if (!empty($params['site_id'])) {
$update_params['site_id'] = $params['site_id'];
}
//部门
if (!empty($params['district_id'])) {
$update_params['district_id'] = $params['district_id'];
}
if (!empty($params['title'])) {
$update_params['title'] = $params['title'];
}
if (!empty($params['content'])) {
$update_params['content'] = $params['content'];
}
if (!empty($params['cover_img'])) {
$update_params['cover_img'] = $params['cover_img'];
}
if(!$update_params){
return false;
}
$res = $this->m_square->updateStatus($where_params, $update_params);
return $res;
}
}
\ No newline at end of file
......@@ -92,6 +92,23 @@ class Square extends Basic
}
}
public function editSquare() {
header('Access-Control-Allow-Origin:*');
$params = $this->params;
if (!isset($params['id']) ) {
return $this->response("101", "参数不全");
}
$res= $this->s_square->editSquare($params);
if ($res) {
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
......
......@@ -100,7 +100,7 @@ class BSquare extends Model
public function updateStatus($where_params,$update_params)
{
$result = $this->where($where_params)->update($update_params);
// dump($this->getLastSql());
// dump($this->getLastSql());exit;
// big_log($this->getLastSql());
return $result;
}
......
......@@ -445,6 +445,7 @@ Route::group('index', [
'getSquareList' => ['index/Square/getSquareList', ['method' => 'GET|POST']],
'getSquareInfo' => ['index/Square/getSquareInfo', ['method' => 'GET|POST']],
'delSquare' => ['index/Square/delSquare', ['method' => 'GET|POST']],
'editSquare' => ['index/Square/editSquare', ['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