Commit 06dcbfaa authored by clone's avatar clone

1

parent 83e45dfb
......@@ -65,7 +65,8 @@ class OfficeBargainService
$bargainModel = new OfficeOBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone,
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,d.internal_title,d.internal_address,b.id as report_id";
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,e.title internal_title,
CONCAT(e.address,d.room_number) internal_address,b.id as report_id";
$result = $bargainModel->selectBargainList($filed, $condition, $pageNo, $pageSize);
......
......@@ -1451,8 +1451,8 @@ class OfficeOrderLogService
$bargainModel = new OfficeOBargainModel();
$bargain_info_filed = "a.id,a.house_number,a.account_time,a.account_statement,a.father_id,a.is_open,a.trade_type,
a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,c.internal_title,c.internal_address,
d.user_id,d.user_phone,d.user_name";
a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,e.title internal_title,
CONCAT(e.address,c.room_number) internal_address, d.user_id,d.user_phone,d.user_name";
$result = [];
$bargainInfo = $bargainModel->selectBargainDetail($bargain_info_filed, $params);
......
......@@ -258,14 +258,14 @@ class OfficeOBargainModel extends Model
}
if (!isset($params["type"]) && isset($params["keyword"])) {
$where_["b.user_phone|b.user_name|d.internal_address"] = array( "like", "%" . $params["keyword"] . "%" );
$where_["b.user_phone|b.user_name|e.address"] = array( "like", "%" . $params["keyword"] . "%" );
}
switch ((int)$params["type"]){ //1商铺id 2商铺地址 3成交报告id 4带看id 5客户id
case 1:
$where_["d.id"] = $params["keyword"];
break;
case 2:
$where_["d.internal_address"] = array("like" , "%" . trim($params['keyword']) . "%");
$where_["e.address"] = array("like" , "%" . trim($params['keyword']) . "%");
break;
case 3:
$where_["a.id"] = $params["keyword"];
......@@ -287,9 +287,10 @@ class OfficeOBargainModel extends Model
$result = $this->db_
->field($filed)
->alias("a")
->join("o_report b", "a.report_id = b.id", "left")
->join("o_order c", "a.order_id = c.id", "left")
->join("g_houses d", "c.house_id = d.id", "left")
->join("office_o_report b", "a.report_id = b.id", "left")
->join("office_o_order c", "a.order_id = c.id", "left")
->join("office_g_room d", "c.house_id = d.id", "left")
->join("office_g_building e", "e.id = d.building_id", "left")
->where($where_)
->order("a.create_time desc")
->limit($pageSize)
......@@ -319,8 +320,9 @@ class OfficeOBargainModel extends Model
$result = $this->db_
->field($filed)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
->join("office_g_room c", "b.house_id = c.id", "left")
->join("office_g_building e", "e.id = c.building_id", "left")
->join("o_report d", "a.report_id = d.id", "left")
->where($where_)
->whereOr($whereOr_)
......@@ -366,70 +368,7 @@ class OfficeOBargainModel extends Model
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 getBargainList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
return $this->db_->field($field)->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('o_partial_commission e', 'a.id = e.bargain_id', 'left')
//->join('o_paylog f', 'a.id = f.bargain_id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('a.id')
->select();
}
/**
* @param string $field
* @param string $params
* @return float|int
*/
public function getBargainListSum($field = '', $params = '')
{
return $this->db_->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
//->join('o_paylog f', 'a.id = f.bargain_id', 'left')
->where($params)
->sum($field);
}
/**
* 成交报告总数
*
* @param array $params
* @return int
*/
public function getBargainTotal(array $params = [])
{
return $this->db_->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
//->join('o_paylog f', 'a.id = f.bargain_id', 'left')
->where($params)
->group('a.id')
->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