Commit ee779f73 authored by zhuwei's avatar zhuwei

bug

parent 4d9e5ebc
......@@ -105,8 +105,8 @@ class Member extends Basic{
$where['a.create_time'] = ['between time', [$params['start_date']. ' 00:00:00', $params['end_date'] . ' 23:59:59']];
}else{
if (empty($params['id']) && empty($params['phone'])) {
//$time_ = date('Y-m-d H:i:s', strtotime("-1 day"));
//$where['a.create_time'] = array( 'lt', $time_ );
//$time_ = date('Y-m-d H:i:s', strtotime("-1 day"));//根据create_time排除保护期客户-废弃
//$where['a.create_time'] = array( 'lt', $time_ );//根据create_time排除保护期客户-废弃
//排除排除保护期内的客户
$time_now = date('Y-m-d H:i:s');//当前时间
//protect_time 将截止日期大于当前时间的数据排除掉
......
......@@ -105,15 +105,10 @@ class PerformanceInfo extends Basic
$field .= 'Oorder.house_id';
$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;
//截取字符串前3位
//商铺地址只显示前3位,后面*替代
$return[$key]['landmark'] = $val["internal_address"] ? mb_substr($val["internal_address"],0,3,'utf-8').'****' : '';
}//end
}
$return_total = $this->oBargainModel->performancelInfoTotal($where,$field);
$field = 'sum(Obargain.scale_fee) as scale_fee_sum';
......@@ -184,7 +179,7 @@ class PerformanceInfo extends Basic
$field .= 'District.district_name,';
$field .= 'Obargain.scale,';
$field .= 'Obargain.scale_fee,';
$field .= 'Obargain.practical_fee';
$field .= 'PartialCommission.practical_fee';
$return = $this->oBargainModel->performancelInfoExcel($where,$field);
if(!$return){
......@@ -192,7 +187,7 @@ class PerformanceInfo extends Basic
}
$export = new ExportExcelUntil();
$e_data_new = [];
foreach ($return as $key => $v) {
$e_data_old['create_time'] = $v['create_time'];//提交时间
......@@ -206,10 +201,6 @@ class PerformanceInfo extends Basic
$e_data_old['trade_type'] = "好处费";
}
/*o_partial_commission表查询实收数据 2018-10-10 10:35:42 朱伟*/
$m_commission = new OPartialCommission();
$return_ = $m_commission->getPracticalFee($v["id"]);
$practical_fee = $return_[0]['practical_fee'] ? $return_[0]['practical_fee'] : 0;//end
//商铺地址截取字符串前3位,后面做隐藏 --暂时不用,后期可直接解除注释
//$landmark = $v["landmark"] ? mb_substr($v["landmark"],0,3,'utf-8').'****' : '';
......@@ -222,12 +213,12 @@ class PerformanceInfo extends Basic
$e_data_old['district_name'] = $v['store_name'];//所属部门
$e_data_old['scale'] = $v['scale'];//分佣比例
$e_data_old['scale_fee'] = $v['scale_fee'];//应收佣金
$e_data_old['practical_fee'] = $practical_fee;//实收佣金
$e_data_old['practical_fee'] = $v['practical_fee'];//实收佣金
$e_data_new[]=$e_data_old;
}
$title = [ '提交时间', '成交类型', '商铺地址', '商铺编号', '分佣提成方', '所属部门门店', '分佣比例', '应收佣金', '实收佣金' ];
$export->exportTable('业绩明细', $e_data_new, 10, '业绩明细表', $title);
$export->exportTable('业绩明细', $e_data_new, count($e_data_new[0]), '业绩明细表', $title);
return '';
}
......
......@@ -1405,6 +1405,8 @@ class OBargainModel extends Model
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join('a_store Store', 'Agent.store_id = Store.id', 'left')
->join('a_district District', 'Agent.district_id = District.id', 'left')
->join('o_partial_commission PartialCommission', 'PartialCommission.bargain_id = Obargain.id', 'left')
->where($where)
->order("Obargain.create_time desc")
->select();
......
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