Commit a240d34c authored by clone's avatar clone

bug

parent 1d4da3d7
...@@ -11,6 +11,7 @@ namespace app\api\controller; ...@@ -11,6 +11,7 @@ namespace app\api\controller;
*/ */
use app\api\extend\Basic; use app\api\extend\Basic;
use app\model\SubletModel; use app\model\SubletModel;
use think\Exception;
use think\Request; use think\Request;
class Sublet extends Basic class Sublet extends Basic
...@@ -29,12 +30,12 @@ class Sublet extends Basic ...@@ -29,12 +30,12 @@ class Sublet extends Basic
*/ */
public function subletList() public function subletList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 1, "user_id" => 1,
"page_no" => 1, "page_no" => 1,
"page_size" => 15 "page_size" => 15
);*/ );*/
$user_id = $params["user_id"]; $user_id = $params["user_id"];
if (!$user_id) { if (!$user_id) {
return $this->response("101", "用户id不能为空"); return $this->response("101", "用户id不能为空");
...@@ -45,11 +46,19 @@ class Sublet extends Basic ...@@ -45,11 +46,19 @@ class Sublet extends Basic
$fields = 'id,manage_type,address_detail,FORMAT(expected_rent/100,2) as expected_rent,create_time,status,house_id'; $fields = 'id,manage_type,address_detail,FORMAT(expected_rent/100,2) as expected_rent,create_time,status,house_id';
$result = $this->subletMode->getSublet($pageNo, $pageSize, "id desc", $fields, $select_); try {
if (count($result) > 0) $result = $this->subletMode->getSublet($pageNo, $pageSize, "id desc", $fields, $select_);
return $this->response("200", "success", $result); if (count($result) > 0) {
return $this->response("200", "success", $result);
} else {
return $this->response("200", "request null");
}
} catch (Exception $exception) {
return $this->response("101", "请求异常,请稍后再试");
}
return $this->response("101", "请求异常,请稍后再试");
} }
public function addSublet() public function addSublet()
......
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