Commit 322e5ac5 authored by hujun's avatar hujun

成交报告分页

parent d0fe90e5
......@@ -50,8 +50,8 @@ class Finance extends Basic
}
$bargain = new OBargainModel();
$data['data'] = $bargain->getBargain($pageNo, $pageSize, 'a.id DESC', $fields, $where);
$data['data'] = $bargain->getBargainTotal($pageNo, $pageSize, 'a.id DESC', $fields, $where);
$data['data']['list'] = $bargain->getBargain($pageNo, $pageSize, 'a.id DESC', $fields, $where);
$data['data']['total'] = $bargain->getBargainTotal($pageNo, $pageSize, 'a.id DESC', $fields, $where);
}
$result = $this->response($data['code'], $data['msg'], $data['data']);
} else {
......
......@@ -194,10 +194,7 @@ class OBargainModel extends Model
* 成交报告总数
*
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @return int|string
*/
public function getBargainTotal($params = '') {
return $this->alias('a')
......@@ -205,7 +202,7 @@ class OBargainModel extends Model
->join('o_order c','a.order_id = c.id','left')
->join('g_houses d','c.house_id = d.id','left')
->where($params)
->select();
->count();
}
/**
......
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