Commit c4843a3b authored by hujun's avatar hujun

500

parent 18d9b91e
...@@ -88,14 +88,14 @@ class Finance extends Basic ...@@ -88,14 +88,14 @@ class Finance extends Basic
$check_status = $this->params['check_status']; $check_status = $this->params['check_status'];
$fields = 'a.id,a.create_time,a.trade_type,d.internal_title, $fields = 'a.id,a.create_time,a.trade_type,d.internal_title,
d.internal_address,a.commission,a.practical_fee,a.scale_fee,a.order_no, d.internal_address,a.commission,a.practical_fee,a.scale_fee,a.order_no,
a.order_id,content,house_number,a.is_open,a.agent_id,a.submit_agent_name, a.order_id,content,a.house_number,a.is_open,a.agent_id,a.submit_agent_name,
a.price,a.audit_level,e.id as partial_commission_id,b.user_phone,b.user_name'; a.price,a.audit_level,e.id as partial_commission_id,b.user_phone,b.user_name';
$where['a.father_id'] = 0; $where['a.father_id'] = 0;
$where['a.status'] = 11; $where['a.status'] = 11;
$order = 'a.id desc'; $order = 'a.id desc';
$is_show = 0; $is_show = 0;
// $where[] = ['EXP', 'f.id is NOT null'];
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) { if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = [ '> time', $this->params['create_time'] . ' 00:00:00' ]; $where['a.create_time'] = [ '> time', $this->params['create_time'] . ' 00:00:00' ];
$is_show = 1; $is_show = 1;
...@@ -306,21 +306,10 @@ class Finance extends Basic ...@@ -306,21 +306,10 @@ class Finance extends Basic
if (!empty($list_data)) { if (!empty($list_data)) {
$excel_data = []; $excel_data = [];
$m_real = new ORealIncome(); $m_real = new ORealIncome();
$trade_type_arr = [
10=>'出租 ',20=>'增佣',30=>'代理',40=>'好处费'
];
foreach ($list_data as $k=>$v) { foreach ($list_data as $k=>$v) {
switch ($v['trade_type']) {
case 10 :
$string = '出租 ';break;
case 20 :
$string = '增佣 ';break;
case 30 :
$string = '代理 ';break;
case 40 :
$string = '好处费 ';break;
default :
$string = '其他';
}
$excel_data[$k]['id'] = $v['id']; $excel_data[$k]['id'] = $v['id'];
$excel_data[$k]['create_time'] = $v['create_time']; $excel_data[$k]['create_time'] = $v['create_time'];
$excel_data[$k]['is_open'] = $v['is_open'] ? '是':'否'; $excel_data[$k]['is_open'] = $v['is_open'] ? '是':'否';
...@@ -328,7 +317,7 @@ class Finance extends Basic ...@@ -328,7 +317,7 @@ class Finance extends Basic
$excel_data[$k]['house_number'] = $v['house_number']; $excel_data[$k]['house_number'] = $v['house_number'];
$excel_data[$k]['price'] = $v['price']; $excel_data[$k]['price'] = $v['price'];
$excel_data[$k]['submit_agent_name'] = $v['submit_agent_name']; $excel_data[$k]['submit_agent_name'] = $v['submit_agent_name'];
$excel_data[$k]['trade_type'] = $string; $excel_data[$k]['trade_type'] = array_key_exists($v['trade_type'], $trade_type_arr) ? $trade_type_arr[$v['labels_id']] : '其他';
$excel_data[$k]['commission'] = $v['commission']; $excel_data[$k]['commission'] = $v['commission'];
$excel_data[$k]['income_money'] = $m_real->sumField('money',['bargain_id'=>$v['id'], 'is_del'=>0]); $excel_data[$k]['income_money'] = $m_real->sumField('money',['bargain_id'=>$v['id'], 'is_del'=>0]);
...@@ -3908,7 +3897,7 @@ class Finance extends Basic ...@@ -3908,7 +3897,7 @@ class Finance extends Basic
return $this->response($code, '参数错误'); return $this->response($code, '参数错误');
} }
$msg = ''; $msg = '';
$where['status'] = 20; $where['a.status'] = 20;
$where[] = ['EXP', 'a.id ='.$this->params['id'].' OR a.father_id='.$this->params['id']]; $where[] = ['EXP', 'a.id ='.$this->params['id'].' OR a.father_id='.$this->params['id']];
$agent_arr = $this->m_bargain->agentBargainAll('a.create_time,a.agent_id,b.store_id,b.district_id', $where); $agent_arr = $this->m_bargain->agentBargainAll('a.create_time,a.agent_id,b.store_id,b.district_id', $where);
......
...@@ -366,6 +366,7 @@ class OBargainModel extends Model ...@@ -366,6 +366,7 @@ class OBargainModel extends Model
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.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_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('o_paylog f', 'a.id = f.bargain_id', 'left')
->where($params) ->where($params)
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
...@@ -403,6 +404,7 @@ class OBargainModel extends Model ...@@ -403,6 +404,7 @@ class OBargainModel extends Model
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.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_partial_commission e', 'e.bargain_id = a.id', 'left')
->join('o_paylog f', 'a.id = f.bargain_id', 'left')
->where($params) ->where($params)
->group('a.id') ->group('a.id')
->count(); ->count();
......
...@@ -362,9 +362,7 @@ define(['doT', 'text!temp/wait_backout_template_tpl.html', 'text!temp/reportList ...@@ -362,9 +362,7 @@ define(['doT', 'text!temp/wait_backout_template_tpl.html', 'text!temp/reportList
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
alert(data.msg);
bargain.getList(1); bargain.getList(1);
}else{ }else{
alert(data.msg) alert(data.msg)
} }
......
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