Commit d3a0394d authored by zhuwei's avatar zhuwei

业绩排行-业绩-明细-实收数据

parent bcb1b2a3
...@@ -690,9 +690,9 @@ class Finance extends Basic ...@@ -690,9 +690,9 @@ class Finance extends Basic
*/ */
public function partialCommissionList() public function partialCommissionList()
{ {
if (!$this->request->isAjax()) { // if (!$this->request->isAjax()) {
return view('commission'); // return view('commission');
} // }
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
...@@ -750,6 +750,7 @@ class Finance extends Basic ...@@ -750,6 +750,7 @@ class Finance extends Basic
try { try {
$data['data']['list'] = $m_commission->getCommissionBargainList($pageNo, $pageSize, 'a.id desc', $field, $where); $data['data']['list'] = $m_commission->getCommissionBargainList($pageNo, $pageSize, 'a.id desc', $field, $where);
//dump($data['data']['list']);exit;
$data['data']['total'] = $m_commission->getCommissionBargainListTotal($where); $data['data']['total'] = $m_commission->getCommissionBargainListTotal($where);
if ($select) { if ($select) {
......
...@@ -12,6 +12,7 @@ namespace app\index\controller; ...@@ -12,6 +12,7 @@ namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\untils\ExportExcelUntil; use app\index\untils\ExportExcelUntil;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OPartialCommission;
use think\Session; use think\Session;
class PerformanceInfo extends Basic class PerformanceInfo extends Basic
...@@ -44,43 +45,43 @@ class PerformanceInfo extends Basic ...@@ -44,43 +45,43 @@ class PerformanceInfo extends Basic
$where['Houses.shop_type'] = $this->params['shop_type']; $where['Houses.shop_type'] = $this->params['shop_type'];
} }
//todo 成交类型 // 成交类型
if ($this->params['trade_type'] != NULL) { if ($this->params['trade_type'] != NULL) {
$where['Obargain.trade_type'] = $this->params['trade_type']; $where['Obargain.trade_type'] = $this->params['trade_type'];
} }
//todo 商铺地址 // 商铺地址
if ($this->params['landmark'] != NULL) { if ($this->params['landmark'] != NULL) {
$where['Houses.landmark'] = ['like', '%'.$this->params['landmark'].'%']; $where['Houses.landmark'] = ['like', '%'.$this->params['landmark'].'%'];
} }
//todo 商铺编号 // 商铺编号
if ($this->params['house_id'] != NULL) { if ($this->params['house_id'] != NULL) {
$where['Houses.id'] = $this->params['house_id']; $where['Houses.id'] = $this->params['house_id'];
} }
//todo 部门 // 部门
if ($this->params['district_id'] != NULL) { if ($this->params['district_id'] != NULL) {
$where['District.id'] = $this->params['district_id'] ; $where['District.id'] = $this->params['district_id'] ;
} }
//todo 门店 // 门店
if ($this->params['store_id'] != NULL) { if ($this->params['store_id'] != NULL) {
$where['Store.id'] = $this->params['store_id'] ; $where['Store.id'] = $this->params['store_id'] ;
} }
//todo 经纪人ID // 经纪人ID
if ($this->params['agents_id'] != NULL) { if ($this->params['agents_id'] != NULL) {
$where['Agent.id'] = $this->params['agents_id']; $where['Agent.id'] = $this->params['agents_id'];
} }
//todo 姓名 // 姓名
if ($this->params['name'] != NULL) { if ($this->params['name'] != NULL) {
$where['Agent.name'] = ['like', '%'.$this->params['name'].'%']; $where['Agent.name'] = ['like', '%'.$this->params['name'].'%'];
} }
//todo 手机号 // 手机号
if ($this->params['phone'] != NULL) { if ($this->params['phone'] != NULL) {
$where['Agent.phone'] = ['like', '%'.$this->params['phone'].'%']; $where['Agent.phone'] = ['like', '%'.$this->params['phone'].'%'];
} }
//todo 成交报告id // 成交报告id
if ($this->params['bargain_id'] != NULL) { if ($this->params['bargain_id'] != NULL) {
$where['Obargain.id'] = $this->params['bargain_id']; $where['Obargain.id'] = $this->params['bargain_id'];
} }
...@@ -100,6 +101,14 @@ class PerformanceInfo extends Basic ...@@ -100,6 +101,14 @@ class PerformanceInfo extends Basic
$field .= 'Houses.landmark,'; $field .= 'Houses.landmark,';
$field .= 'Oorder.house_id'; $field .= 'Oorder.house_id';
$return = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo); $return = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo);
/*o_partial_commission表查询实收数据 2018-10-10 10:35:42 朱伟*/
$m_commission = new OPartialCommission();
foreach ($return as $key => $val) {
$return_ = $m_commission->getPracticalFee($val["id"]);
$return[$key]['practical_fee'] = $return_[0]['practical_fee'] ? $return_[0]['practical_fee'] : 0;
}//end
$return_total = $this->oBargainModel->performancelInfoTotal($where,$field); $return_total = $this->oBargainModel->performancelInfoTotal($where,$field);
$field = 'sum(Obargain.scale_fee) as scale_fee_sum'; $field = 'sum(Obargain.scale_fee) as scale_fee_sum';
$return_sum = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo); $return_sum = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo);
...@@ -128,32 +137,32 @@ class PerformanceInfo extends Basic ...@@ -128,32 +137,32 @@ class PerformanceInfo extends Basic
$where['Houses.shop_type'] = $this->params['shop_type']; $where['Houses.shop_type'] = $this->params['shop_type'];
} }
//todo 成交类型 // 成交类型
if ($this->params['trade_type'] != NULL) { if ($this->params['trade_type'] != NULL) {
$where['Obargain.trade_type'] = $this->params['trade_type']; $where['Obargain.trade_type'] = $this->params['trade_type'];
} }
//todo 商铺地址 // 商铺地址
if ($this->params['landmark'] != NULL) { if ($this->params['landmark'] != NULL) {
$where['Houses.landmark'] = ['like', '%'.$this->params['landmark'].'%']; $where['Houses.landmark'] = ['like', '%'.$this->params['landmark'].'%'];
} }
//todo 商铺编号 // 商铺编号
if ($this->params['house_id'] != NULL) { if ($this->params['house_id'] != NULL) {
$where['Houses.id'] = $this->params['house_id']; $where['Houses.id'] = $this->params['house_id'];
} }
//todo 部门 // 部门
if ($this->params['district_id'] != NULL) { if ($this->params['district_id'] != NULL) {
$where['District.id'] = $this->params['district_id'] ; $where['District.id'] = $this->params['district_id'] ;
} }
//todo 门店 // 门店
if ($this->params['store_id'] != NULL) { if ($this->params['store_id'] != NULL) {
$where['Store.id'] = $this->params['store_id'] ; $where['Store.id'] = $this->params['store_id'] ;
} }
//todo 姓名 // 姓名
if ($this->params['name'] != NULL) { if ($this->params['name'] != NULL) {
$where['Agent.name'] = ['like', '%'.$this->params['name'].'%']; $where['Agent.name'] = ['like', '%'.$this->params['name'].'%'];
} }
//todo 手机号 // 手机号
if ($this->params['phone'] != NULL) { if ($this->params['phone'] != NULL) {
$where['Agent.phone'] = ['like', '%'.$this->params['phone'].'%']; $where['Agent.phone'] = ['like', '%'.$this->params['phone'].'%'];
} }
......
...@@ -471,4 +471,18 @@ class OPartialCommission extends BaseModel ...@@ -471,4 +471,18 @@ class OPartialCommission extends BaseModel
->where($where) ->where($where)
->find(); ->find();
} }
/**
* 查询实收数据
*/
public function getPracticalFee($bargain_id)
{
$params['bargain_id'] = $bargain_id;
$field ='practical_fee';
$result = $this->field($field)
->where($params)
->select();
//dump($this->getLastSql());
return $result;
}
} }
\ 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