|
@@ -1,5 +1,5 @@
|
|
|
<?php
|
|
|
-
|
|
|
+require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
|
|
|
class refill_orderControl extends SystemControl
|
|
|
{
|
|
|
public function __construct()
|
|
@@ -10,7 +10,7 @@ class refill_orderControl extends SystemControl
|
|
|
public function indexOp()
|
|
|
{
|
|
|
$fShowStat = $_GET['fShowStat'];
|
|
|
- $this->refill_order($fShowStat==1);
|
|
|
+ $this->refill_order($fShowStat == 1);
|
|
|
}
|
|
|
|
|
|
public function refill_order($fShowStat = false)
|
|
@@ -36,7 +36,7 @@ class refill_orderControl extends SystemControl
|
|
|
$fSingle = true;
|
|
|
}
|
|
|
if (!empty($_GET['no_mchid'])) {
|
|
|
- $no_mchid = explode(',',$_GET['no_mchid']);
|
|
|
+ $no_mchid = explode(',', $_GET['no_mchid']);
|
|
|
$condition['refill_order.mchid'] = ['not in', $no_mchid];
|
|
|
}
|
|
|
|
|
@@ -69,8 +69,7 @@ class refill_orderControl extends SystemControl
|
|
|
}
|
|
|
|
|
|
$fToday = false;
|
|
|
- if (!$fSingle)
|
|
|
- {
|
|
|
+ if (!$fSingle) {
|
|
|
$start_unixtime = intval(strtotime($_GET['query_start_time']));
|
|
|
$end_unixtime = intval(strtotime($_GET['query_end_time']));
|
|
|
|
|
@@ -98,7 +97,7 @@ class refill_orderControl extends SystemControl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(!empty($_GET['export'])) {
|
|
|
+ if (!empty($_GET['export'])) {
|
|
|
$this->RefillOrderExport($condition);
|
|
|
}
|
|
|
$merchants = [];
|
|
@@ -148,12 +147,11 @@ class refill_orderControl extends SystemControl
|
|
|
{
|
|
|
$i = 0;
|
|
|
$result = [];
|
|
|
- while (true)
|
|
|
- {
|
|
|
+ while (true) {
|
|
|
$start = $i * 1000;
|
|
|
$order_list = Model('')->table('refill_order,vr_order')->field('refill_order.*,vr_order.order_state')
|
|
|
->where($condition)->join('inner')->on('refill_order.order_id=vr_order.order_id')->order('refill_order.order_time desc')->limit("{$start},1000")->select();
|
|
|
- if(empty($order_list)) {
|
|
|
+ if (empty($order_list)) {
|
|
|
break;
|
|
|
}
|
|
|
$i++;
|
|
@@ -164,50 +162,51 @@ class refill_orderControl extends SystemControl
|
|
|
$this->createExcel($result);
|
|
|
}
|
|
|
|
|
|
- private function createExcel($data = array()){
|
|
|
+ private function createExcel($data = array())
|
|
|
+ {
|
|
|
Language::read('export');
|
|
|
import('libraries.excel');
|
|
|
$excel_obj = new Excel();
|
|
|
$excel_data = array();
|
|
|
//设置样式
|
|
|
- $excel_obj->setStyle(array('id'=>'s_title','Font'=>array('FontName'=>'宋体','Size'=>'12','Bold'=>'1')));
|
|
|
+ $excel_obj->setStyle(array('id' => 's_title', 'Font' => array('FontName' => '宋体', 'Size' => '12', 'Bold' => '1')));
|
|
|
//header
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '商户号');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '客户订单号');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '平台单号');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '面额');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '充值卡号');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '充值卡类型');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '下单日期');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '完成日期');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '官方流水号');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '订单状态');
|
|
|
- $excel_data[0][] = array('styleid'=>'s_title','data'=> '扣款金额');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '商户号');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '客户订单号');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '平台单号');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '面额');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '充值卡号');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '充值卡类型');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '下单日期');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '完成日期');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '官方流水号');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '订单状态');
|
|
|
+ $excel_data[0][] = array('styleid' => 's_title', 'data' => '扣款金额');
|
|
|
//data
|
|
|
- foreach ((array)$data as $k=>$v){
|
|
|
+ foreach ((array)$data as $k => $v) {
|
|
|
$tmp = array();
|
|
|
- $tmp[] = array('data'=>$v['mchid']);
|
|
|
- $tmp[] = array('data'=>$v['mch_order']);
|
|
|
- $tmp[] = array('data'=>$v['order_sn']);
|
|
|
- $tmp[] = array('data'=>$v['refill_amount']);
|
|
|
- $tmp[] = array('data'=>$v['card_no']);
|
|
|
- $tmp[] = array('data'=>$this->scard_type($v['card_type']));
|
|
|
- $tmp[] = array('data'=>date('Y-m-d H:i:s',$v['order_time']));
|
|
|
- if(empty($v['notify_time'])) {
|
|
|
- $tmp[] = array('data'=>'');
|
|
|
- }else{
|
|
|
- $tmp[] = array('data'=>date('Y-m-d H:i:s',$v['notify_time']));
|
|
|
+ $tmp[] = array('data' => $v['mchid']);
|
|
|
+ $tmp[] = array('data' => $v['mch_order']);
|
|
|
+ $tmp[] = array('data' => $v['order_sn']);
|
|
|
+ $tmp[] = array('data' => $v['refill_amount']);
|
|
|
+ $tmp[] = array('data' => $v['card_no']);
|
|
|
+ $tmp[] = array('data' => $this->scard_type($v['card_type']));
|
|
|
+ $tmp[] = array('data' => date('Y-m-d H:i:s', $v['order_time']));
|
|
|
+ if (empty($v['notify_time'])) {
|
|
|
+ $tmp[] = array('data' => '');
|
|
|
+ } else {
|
|
|
+ $tmp[] = array('data' => date('Y-m-d H:i:s', $v['notify_time']));
|
|
|
}
|
|
|
|
|
|
- $tmp[] = array('data'=>$v['official_sn']);
|
|
|
- $tmp[] = array('data'=>orderState($v));
|
|
|
- $tmp[] = array('data'=>$v['mch_amount']);
|
|
|
+ $tmp[] = array('data' => $v['official_sn']);
|
|
|
+ $tmp[] = array('data' => orderState($v));
|
|
|
+ $tmp[] = array('data' => $v['mch_amount']);
|
|
|
$excel_data[] = $tmp;
|
|
|
}
|
|
|
- $excel_data = $excel_obj->charset($excel_data,CHARSET);
|
|
|
+ $excel_data = $excel_obj->charset($excel_data, CHARSET);
|
|
|
$excel_obj->addArray($excel_data);
|
|
|
- $excel_obj->addWorksheet($excel_obj->charset(L('exp_od_order'),CHARSET));
|
|
|
- $excel_obj->generateXML($excel_obj->charset(L('exp_od_order'),CHARSET).date('Y-m-d-H',time()));
|
|
|
+ $excel_obj->addWorksheet($excel_obj->charset(L('exp_od_order'), CHARSET));
|
|
|
+ $excel_obj->generateXML($excel_obj->charset(L('exp_od_order'), CHARSET) . date('Y-m-d-H', time()));
|
|
|
exit;
|
|
|
}
|
|
|
|
|
@@ -253,4 +252,20 @@ class refill_orderControl extends SystemControl
|
|
|
echo json_encode($result);
|
|
|
exit;
|
|
|
}
|
|
|
+
|
|
|
+ public function refill_third_infoOP()
|
|
|
+ {
|
|
|
+ $order_id = $_GET['order_id'];
|
|
|
+ $model_refill_order = Model('refill_order');
|
|
|
+ $order_info = $model_refill_order->getOrderInfo(['order_id' => $order_id]);
|
|
|
+ if (empty($model_refill_order) || $order_info['card_type'] != mtopcard\ThirdRefillCard) {
|
|
|
+ $res = ['state' => -1, 'msg' => '订单不存在或类型错误'];
|
|
|
+ exit(json_encode($res));
|
|
|
+ }
|
|
|
+ $third_refill = Model('thrid_refill');
|
|
|
+ $data = $third_refill->getThird($order_id);
|
|
|
+ $data['card_info'] = $data['card_info'] ?? '';
|
|
|
+ $res = ['state' => 1, 'data' => $data];
|
|
|
+ exit(json_encode($res));
|
|
|
+ }
|
|
|
}
|