Commit 5da837b5 authored by hujun's avatar hujun

成交报告列表

parent ee9c57a5
...@@ -10,22 +10,38 @@ namespace app\index\controller; ...@@ -10,22 +10,38 @@ namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\OBargainModel;
class Finance extends Basic class Finance extends Basic
{ {
/** /**
* 成交报告 * 成交报告
* *
* @return \think\response\View * @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function reportList() { public function reportList() {
if ($this->request->isAjax()) {
if ($this->request->get()) {
if ($this->request->isAjax()) {
$data['code'] = 200;
$data['msg'] = "";
$data['data'] = [];
if ($this->request->isGet()) {
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$fields = 'a.id,a.create_time,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.commission,a.practical_fee';
$where['a.father_id'] = 0;
$where['c.is_del'] = 0;
$bargain = new OBargainModel();
$data['data'] = $bargain->getBargain($pageNo, $pageSize, 'a.id DESC', $fields, $where);
} else { } else {
} }
$result = $this->response($data['code'], $data['msg'], $data['data']);
} else { } else {
$result = view('finance/index'); $result = view('finance/index');
} }
......
...@@ -49,6 +49,7 @@ class OBargainModel extends Model ...@@ -49,6 +49,7 @@ class OBargainModel extends Model
/** /**
* 修改信息 * 修改信息
*
* @param $id * @param $id
* @param $params * @param $params
* @return int * @return int
...@@ -69,9 +70,13 @@ class OBargainModel extends Model ...@@ -69,9 +70,13 @@ class OBargainModel extends Model
/** /**
* 查询成交报告记录 * 查询成交报告记录
* @param string $filed *
* @param $filed
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectBargainByOrderNo($filed, $params) public function selectBargainByOrderNo($filed, $params)
{ {
...@@ -95,14 +100,17 @@ class OBargainModel extends Model ...@@ -95,14 +100,17 @@ class OBargainModel extends Model
->select(); ->select();
} }
/** /**
* 获取我得成交 * 获取我得成交
*
* @param $filed * @param $filed
* @param $params * @param $params
* @param $pageNo * @param $pageNo
* @param $pageSize * @param $pageSize
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectBargainList($filed,$params,$pageNo,$pageSize){ public function selectBargainList($filed,$params,$pageNo,$pageSize){
$where_ = []; $where_ = [];
...@@ -130,9 +138,13 @@ class OBargainModel extends Model ...@@ -130,9 +138,13 @@ class OBargainModel extends Model
/** /**
* 获取成交报告详情 * 获取成交报告详情
*
* @param $filed * @param $filed
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectBargainDetail($filed,$params){ public function selectBargainDetail($filed,$params){
$where_ = $whereOr_ =[]; $where_ = $whereOr_ =[];
...@@ -152,4 +164,28 @@ class OBargainModel extends Model ...@@ -152,4 +164,28 @@ class OBargainModel extends Model
echo $this->getLastSql(); echo $this->getLastSql();
return $result; return $result;
} }
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @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 getBargain($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)->alias('a')
->join('o_report b','a.report_id = b.id','left')
->join('o_order c','c.f_id = b.id','left')
->join('g_houses d','c.house_id = d.id','left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
} }
\ No newline at end of file
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