|
@@ -82,6 +82,7 @@ class handler
|
|
|
|
|
|
$normal_cond = $cond['normal'];
|
|
$normal_cond = $cond['normal'];
|
|
$time_scope = $cond['time_scope'];
|
|
$time_scope = $cond['time_scope'];
|
|
|
|
+ $export_type = $cond['export_type'];
|
|
|
|
|
|
$order_reader = function ($normal_cond,$time_scope) use ($tmcond_gen)
|
|
$order_reader = function ($normal_cond,$time_scope) use ($tmcond_gen)
|
|
{
|
|
{
|
|
@@ -112,7 +113,7 @@ class handler
|
|
{
|
|
{
|
|
$start = $i * $len;
|
|
$start = $i * $len;
|
|
$items = $mod->table('refill_order,vr_order')
|
|
$items = $mod->table('refill_order,vr_order')
|
|
- ->field('refill_order.*,vr_order.order_state')
|
|
|
|
|
|
+ ->field('refill_order.*,vr_order.order_state,vr_order.store_name')
|
|
->join('inner')
|
|
->join('inner')
|
|
->on('refill_order.order_id=vr_order.order_id')
|
|
->on('refill_order.order_id=vr_order.order_id')
|
|
->where($cond)
|
|
->where($cond)
|
|
@@ -130,8 +131,15 @@ class handler
|
|
};
|
|
};
|
|
|
|
|
|
$merchants = [];
|
|
$merchants = [];
|
|
- $column_values = ['商户号', '商户订单号', '平台单号','面额', '充值卡号', '充值卡类型', '是否转网', '下单日期', '完成日期', '订单状态', '扣款金额'];
|
|
|
|
- $data_keys = ['mchid', 'mch_order', 'order_sn', 'refill_amount', 'card_no', 'card_type_text', 'is_transfer_text', 'order_time_text', 'notify_time_text','order_state_text', 'mch_amount'];
|
|
|
|
|
|
+ $column_values = ['平台单号','面额', '充值卡号', '充值卡类型', '是否转网', '下单日期', '完成日期', '订单状态'];
|
|
|
|
+ $data_keys = ['order_sn', 'refill_amount', 'card_no', 'card_type_text', 'is_transfer_text', 'order_time_text', 'notify_time_text','order_state_text'];
|
|
|
|
+ if($export_type === 'merchant') {
|
|
|
|
+ $column_values = array_merge(['商户号', '商户订单号'], $column_values, ['扣款金额']);
|
|
|
|
+ $data_keys = array_merge(['mchid', 'mch_order'], $data_keys, ['mch_amount']);
|
|
|
|
+ }elseif ($export_type === 'provider') {
|
|
|
|
+ $column_values = array_merge(['上游名称', '上游订单号'], $column_values, ['折扣金额']);
|
|
|
|
+ $data_keys = array_merge(['store_name', 'ch_trade_no'], $data_keys, ['channel_amount']);
|
|
|
|
+ }
|
|
$merchant_list = Model('')->table('merchant')->limit(1000)->order('company_name asc')->select();
|
|
$merchant_list = Model('')->table('merchant')->limit(1000)->order('company_name asc')->select();
|
|
foreach ($merchant_list as $value) {
|
|
foreach ($merchant_list as $value) {
|
|
$merchants[$value['mchid']] = $value;
|
|
$merchants[$value['mchid']] = $value;
|