Commit ba4c35c9 authored by clone's avatar clone

bug

parent 3183f8f0
......@@ -31,8 +31,8 @@ class Sublet extends Basic
public function subletList()
{
$params = $this->params;
/* $params = array(
"user_id" => 1,
/* $params = array(
"user_id" => 13,
"page_no" => 1,
"page_size" => 15
);*/
......@@ -42,9 +42,10 @@ class Sublet extends Basic
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$select_["user_id"] = $user_id;
$select_["a.user_id"] = $user_id;
$fields = 'id,manage_type,address_detail,FORMAT(expected_rent/100,2) as expected_rent,create_time,status,house_id';
$fields = 'a.id,a.manage_type,a.address_detail,FORMAT(a.expected_rent/100,2) as expected_rent,a.create_time,
if(b.status=2,"3",a.status) as status,a.house_id';
try {
$result = $this->subletMode->getSublet($pageNo, $pageSize, "id desc", $fields, $select_);
......@@ -55,7 +56,7 @@ class Sublet extends Basic
}
} catch (Exception $exception) {
return $this->response("101", "请求异常,请稍后再试");
return $this->response("101", "请求异常,请稍后再试,".$exception);
}
......
......@@ -48,34 +48,35 @@ class Transfer extends Basic
$where = array();
if (!empty($params['start_date']) && empty($params['end_date'])) {
$where['create_time'] = ['> time', $params['start_date']];
$where['a.create_time'] = ['> time', $params['start_date']];
}
if (!empty($params['end_date']) && empty($params['start_date'])) {
$where['create_time'] = ['< time', $params['end_date']];
$where['a.create_time'] = ['< time', $params['end_date']];
}
if (!empty($params['start_date']) && !empty($params['end_date'])) {
$where['create_time'] = ['between time', [$params['start_date'],$params['end_date']]];
$where['a.create_time'] = ['between time', [$params['start_date'],$params['end_date']]];
}
if (!empty($params['name'])) {
$where['appellation'] = ['like', $params['name'].'%'];
$where['a.appellation'] = ['like', $params['name'].'%'];
}
if (!empty($params['phone'])) {
$where['tel'] = ['like', $params['phone'].'%'];
$where['a.tel'] = ['like', $params['phone'].'%'];
}
if (!empty($params['shop_name'])) {
$where['shop_name'] = ['like', $params['shop_name'].'%'];
$where['a.shop_name'] = ['like', $params['shop_name'].'%'];
}
$sublet = new SubletModel();
$fields = 'id,shop_name,manage_type,address_detail,province,city,district,FORMAT(expected_rent/100,2) as expected_rent,appellation,tel,create_time,status';
$fields = 'a.id,a.shop_name,a.manage_type,a.address_detail,a.province,a.city,a.district,FORMAT(a.expected_rent/100,2) as expected_rent,
if(b.status=2,"3",a.status) as status,a.appellation,a.tel,a.create_time,a.status';
$data['list'] = $sublet->getSublet($pageNo, $pageSize, 'id desc', $fields, $where);
$data['list'] = $sublet->getSublet($pageNo, $pageSize, 'a.id desc', $fields, $where);
$data['total'] = $sublet->getSubletTotal($where);
return $this->response($data['status'], $data['msg'], $data);
......
......@@ -46,6 +46,8 @@ class SubletModel extends BaseModel
public function getSublet($pageNo = 1, $pageSize = 15, $order_ = '', $fields = '*', $params = '')
{
$result = $this->field($fields)
->alias("a")
->join("g_houses b","a.house_id=b.id","left")
->where($params)
->order($order_)
->limit($pageSize)
......
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