Commit 2b73a757 authored by zhuwei's avatar zhuwei

退款审核明细表

parent 1e7c0800
...@@ -961,35 +961,78 @@ class Finance extends Basic ...@@ -961,35 +961,78 @@ class Finance extends Basic
} }
} }
$fields = 'a.create_time,a.id,a.order_id,a.pay_log_id,a.refund_money,a.type,a.agent_id,a.agent_name,b.house_id,a.status,'; $fields = 'a.create_time,a.id,a.type,a.order_id,a.pay_log_id,a.refund_money,';
$fields .= 'd.income_time,a.type,c.store_id'; $fields .= 'd.income_time,a.status,c.store_id,a.agent_name,b.house_id';
$list = $refund->getCheckRefundList($pageNo, $pageSize, 'a.id DESC', $fields, $where); $list = $refund->getCheckRefundListForExcel( 'a.id DESC', $fields, $where);
foreach ($list as $k=>$v) { foreach ($list as $k=>$v) {
if (($v['status'] == 0)or($v['status'] == 1) ) {
$v['status'] = '审核中';
} elseif ($v['status'] == 2) {
$v['status'] = '退款成功';
}elseif ($v['status'] == 3) {
$v['status'] = '已审核';
}elseif ($v['status'] == 4) {
$v['status'] = '驳回';
}else{
$v['status'] = '';
}
if ($v['type'] == 1 ) {
$v['type'] = '意向金转定';
} elseif ($v['type'] == 2) {
$v['type'] = '退保管金';
}elseif ($v['type'] == 3) {
$v['type'] = '保管金转定';
}elseif ($v['type'] == 4) {
$v['type'] = '退中介费';
}elseif ($v['type'] == 5) {
$v['type'] = '退案场费';
}elseif ($v['type'] == 0) {
$v['type'] = '退意向金';
}else{
$v['type'] = '';
}
if (empty($v['house_id'])) { if (empty($v['house_id'])) {
$list[$k]['address'] = ''; $v['address'] = '';
} else { } else {
$list[$k]['address'] = $m_house->getHouseValue('internal_address', ['id'=>$v['house_id']]); $v['address'] = $m_house->getHouseValue('internal_address', ['id'=>$v['house_id']]);
} }
if (empty($v['store_id'])) { if (empty($v['store_id'])) {
$list[$k]['store_name'] = ''; $v['store_name'] = '';
} else { } else {
$list[$k]['store_name'] = $m_store->getStoreKeyById('store_name', ['id'=> $v['store_id']]); $v['store_name'] = $m_store->getStoreKeyById('store_name', ['id'=> $v['store_id']]);
} }
$excel_data_ = [];
$excel_data_[] = $v['create_time'];
$excel_data_[] = $v['id'];
$excel_data_[] = $v['status'];
$excel_data_[] = $v['order_id'];
$excel_data_[] = $v['pay_log_id'];
$excel_data_[] = $v['refund_money'];
$excel_data_[] = $v['income_time'];
$excel_data_[] = $v['type'];
$excel_data_[] = $v['agent_name'];
$excel_data_[] = $v['store_name'];
$excel_data_[] = $v['house_id'];
$excel_data_[] = $v['address'];
$excel_data[] = $excel_data_;
} }
$total_money = $refund->getSumMoney($where); $total_money = $refund->getSumMoney($where);
dump($list);exit;
if(!$list){ if(!$list){
return '<script>alert("退款审核表失败");window.close();</script>'; return '<script>alert("导出失败");window.close();</script>';
} }
$export = new ExportExcelUntil(); $export = new ExportExcelUntil();
$title = [ '提交时间','退款ID','状态','订单ID','收款ID','退款金额','入账日期','退款类型','提交人','所属门店','商铺ID','商铺地址']; $title = [ '提交时间','退款ID','状态','订单ID','收款ID','退款金额','入账日期','退款类型','提交人','所属门店','商铺ID','商铺地址'];
$export->exportTable('退款审核 退款总计:'.$total_money, $list, 11, '实收明细表', $title); $export->exportTable('退款审核明细表', $excel_data, 11, '退款审核明细表 (退款总计:'.$total_money.')', $title);
return ''; return '';
} }
......
...@@ -237,6 +237,19 @@ class ORefundModel extends Model{ ...@@ -237,6 +237,19 @@ class ORefundModel extends Model{
->select(); ->select();
} }
public function getCheckRefundListForExcel($order_ = 'id desc', $field = '', $params = '') {
return $this->db_->alias('a')
->field($field)
->join('o_order b', 'a.order_id = b.id', 'left')
->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->where($params)
->order($order_)
->group('a.id')
->select();
}
/** /**
* 退款列表 * 退款列表
* *
......
...@@ -55,25 +55,15 @@ class UpdateActivityTask ...@@ -55,25 +55,15 @@ class UpdateActivityTask
continue; continue;
} }
#开始时间大于当时前时间
if( $v['activity_start_time'] > date("Y-m-d H:i:s", time())){ if( $v['activity_start_time'] > date("Y-m-d H:i:s", time())){
//开始时间大于当时前时间 $this->m_active->updateStatus($v['id'],5);
// dump('开始时间大于当时前时间');exit;
$res = $this->m_active->updateStatus($v['id'],5);
// dump($res);exit;
continue; continue;
} }
#结束时间小于当时前时间
if( $v['activity_end_time'] < date("Y-m-d H:i:s", time())){ if( $v['activity_end_time'] < date("Y-m-d H:i:s", time())){
//结束时间小于当时前时间 $this->m_active->updateStatus($v['id'],3);
// dump('结束时间小于当时前时间');exit;
$res = $this->m_active->updateStatus($v['id'],3);
continue;
}
if( ($v['get_number'] >= $v['available']) && ($v['available'] > 0) ){
//已领取数量大于可领数
// dump('已领取数量大于可领数');exit;
$res = $this->m_active->updateStatus($v['id'],2);
continue; continue;
} }
} }
......
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