Commit 0a41c755 authored by hujun's avatar hujun

site_id

parent 2c51e299
...@@ -71,6 +71,8 @@ class Transfer extends Basic ...@@ -71,6 +71,8 @@ class Transfer extends Basic
$where['a.shop_name'] = ['like', $params['shop_name'].'%']; $where['a.shop_name'] = ['like', $params['shop_name'].'%'];
} }
$where['a.city'] = $this->city;
$where['d.site_id'] = $this->siteId;
if (!empty($params['agent_id'])) { if (!empty($params['agent_id'])) {
$where['c.agent_id'] = $params['agent_id']; $where['c.agent_id'] = $params['agent_id'];
}else{ }else{
...@@ -88,9 +90,9 @@ class Transfer extends Basic ...@@ -88,9 +90,9 @@ class Transfer extends Basic
$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, $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'; if(b.status=2,"3",a.status) as status,a.appellation,a.tel,a.create_time,a.status';
$data['list'] = $sublet->getSublet($pageNo, $pageSize, 'a.id desc', $fields, $where); $data['list'] = $sublet->getSubletAgent($pageNo, $pageSize, 'a.id desc', $fields, $where);
$data['total'] = $sublet->getSubletTotal($where); $data['total'] = $sublet->getSubletAgentTotal($where);
return $this->response($data['status'], $data['msg'], $data); return $this->response($data['status'], $data['msg'], $data);
......
...@@ -58,17 +58,47 @@ class SubletModel extends BaseModel ...@@ -58,17 +58,47 @@ class SubletModel extends BaseModel
return $result; return $result;
} }
/**
* 查询转铺记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $fields
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSubletAgent($pageNo = 1, $pageSize = 15, $order_ = '', $fields = '*', $params = '')
{
$result = $this->field($fields)
->alias("a")
->join("g_houses b","a.house_id=b.id","left")
->join("u_user_agent d","a.user_id=d.user_id","left")
->join("u_users c", "d.user_id = c.id", "left")
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
// big_log($this->getLastSql());
return $result;
}
/** /**
* 查询转铺总记录数 * 查询转铺总记录数
* *
* @param $params * @param $params
* @return int|string * @return int|string
*/ */
public function getSubletTotal($params) public function getSubletAgentTotal($params)
{ {
$result = $this->alias("a") $result = $this->alias("a")
->join("g_houses b","a.house_id=b.id","left") ->join("g_houses b","a.house_id=b.id","left")
->join("u_users c", "a.user_id = c.id", "left") ->join("u_user_agent d","a.user_id=d.user_id","left")
->join("u_users c", "d.user_id = c.id", "left")
->where($params) ->where($params)
->count(); ->count();
return $result; return $result;
......
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