|
@@ -843,7 +843,6 @@ class merchantControl extends SystemControl
|
|
|
}
|
|
|
$order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
|
|
|
|
|
|
- $stat = $this->all_order_state_stat($condition);
|
|
|
foreach ($order_list as $order_id => $order_info) {
|
|
|
$order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
|
|
|
$order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
|
|
@@ -856,6 +855,7 @@ class merchantControl extends SystemControl
|
|
|
$order_list[$order_id]['diff_time'] = $diff_time;
|
|
|
}
|
|
|
|
|
|
+ $stat = $this->all_order_state_stat($condition);
|
|
|
$provider_list = Model('')->table('refill_provider,store')
|
|
|
->field('refill_provider.*,store.store_name')
|
|
|
->join('inner')
|
|
@@ -873,6 +873,67 @@ class merchantControl extends SystemControl
|
|
|
Tpl::showpage('refill.order.index');
|
|
|
}
|
|
|
|
|
|
+ public function RefillOrderExport($condition)
|
|
|
+ {
|
|
|
+ $i = 0;
|
|
|
+ $result = [];
|
|
|
+ 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)) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $i++;
|
|
|
+ foreach ($order_list as $order) {
|
|
|
+ $result[] = $order;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $this->createExcel($result);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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')));
|
|
|
+ //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'=> '扣款金额');
|
|
|
+ //data
|
|
|
+ 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']));
|
|
|
+ $tmp[] = array('data'=>date('Y-m-d H:i:s',$v['notify_time']));
|
|
|
+ $tmp[] = array('data'=>$v['official_sn']);
|
|
|
+ $tmp[] = array('data'=>orderState($v['order_state']));
|
|
|
+ $tmp[] = array('data'=>$v['mch_amount']);
|
|
|
+ $excel_data[] = $tmp;
|
|
|
+ }
|
|
|
+ $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()));
|
|
|
+ }
|
|
|
+
|
|
|
public function notify_merchantOp()
|
|
|
{
|
|
|
$order_id = $_GET['order_id'];
|
|
@@ -1519,7 +1580,21 @@ class merchantControl extends SystemControl
|
|
|
$merchant_list = Model('')->table('merchant')->limit(1000)->select();
|
|
|
Tpl::output('merchant_list', $merchant_list);
|
|
|
}
|
|
|
+ $success_count_total = $success_refill_amounts_total = $success_mch_amounts_toatl = $success_channel_amounts_total = 0;
|
|
|
+ foreach ($stats_list as $stats) {
|
|
|
+ $success_count_total += $stats['success_count'];
|
|
|
+ $success_refill_amounts_total += $stats['success_refill_amounts'];
|
|
|
+ $success_mch_amounts_toatl += $stats['success_mch_amounts'];
|
|
|
+ $success_channel_amounts_total += $stats['success_channel_amounts'];
|
|
|
+ }
|
|
|
+ $total_stats = [
|
|
|
+ 'success_count_total' => $success_count_total,
|
|
|
+ 'success_refill_amounts_total' => $success_refill_amounts_total,
|
|
|
+ 'success_mch_amounts_toatl' => $success_mch_amounts_toatl,
|
|
|
+ 'success_channel_amounts_total' => $success_channel_amounts_total
|
|
|
+ ];
|
|
|
$check_text = ['未编辑', '匹配', '不匹配'];
|
|
|
+ Tpl::output('total_stats', $total_stats);
|
|
|
Tpl::output('stats_list', $stats_list);
|
|
|
Tpl::output('check_text', $check_text);
|
|
|
Tpl::output('show_page', $model_refill_order->showpage());
|
|
@@ -1574,6 +1649,18 @@ class merchantControl extends SystemControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function OrderStatsReloadOp()
|
|
|
+ {
|
|
|
+ $stat_id = $_GET['stat_id'];
|
|
|
+ $mod_stat = Model('refill_stats');
|
|
|
+ $stats_data = $mod_stat->getStatsInfo(['stat_id' => $stat_id]);
|
|
|
+ if (empty($stats_data)) {
|
|
|
+ showMessage('对应数据不存在', '');
|
|
|
+ }
|
|
|
+
|
|
|
+ showMessage('操作成功');
|
|
|
+ }
|
|
|
+
|
|
|
public function provider_evidenceOp()
|
|
|
{
|
|
|
$mod = Model('provider_evidence');
|
|
@@ -1662,64 +1749,4 @@ class merchantControl extends SystemControl
|
|
|
Tpl::showpage('provider.evidence.add');
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public function provider_successfulOp()
|
|
|
- {
|
|
|
- $days = $this->successful_where();
|
|
|
- Tpl::output('days', $days);
|
|
|
- Tpl::showpage('provider.successful');
|
|
|
- }
|
|
|
-
|
|
|
- private function successful_where() {
|
|
|
- $url = BASE_SITE_URL . '/plot/days';
|
|
|
- Log::record("successful get timestamp url : {$url}", Log::DEBUG);
|
|
|
- $data = http_request($url);
|
|
|
- if(empty($data)) return [];
|
|
|
- preg_match_all('/\d{10}/', $data, $matches);
|
|
|
- $days = $matches[0];
|
|
|
- if(empty($days)) return [];
|
|
|
- $result = [];
|
|
|
- foreach ($days as $day) {
|
|
|
- $result[$day] = date("Y-m-d",$day);
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
-
|
|
|
- public function successful_time_get_whereOp(){
|
|
|
- $url = BASE_SITE_URL . '/plot/paths?time_stamp='.$_GET['timestamp'];
|
|
|
- Log::record("successful get where url : {$url}", Log::DEBUG);
|
|
|
- $data = http_request($url);
|
|
|
- preg_match_all('/\d{10}\/[a-z]+\/\d{1,2}\/\d\/\d{2,4}/', $data, $matches);
|
|
|
- $conds = $matches[0];
|
|
|
- if(empty($conds)) return [];
|
|
|
- foreach ($conds as $cond) {
|
|
|
- $arr = explode('/',$cond);
|
|
|
- $chname[] = $arr[1];
|
|
|
- $qualitys[] = $arr[2];
|
|
|
- $card_types[] = $arr[3];
|
|
|
- $amount[] = intval($arr[4]);
|
|
|
- }
|
|
|
- $chnameData = array_unique($chname);
|
|
|
- sort($chnameData);
|
|
|
-
|
|
|
- $result['chname'] = $chnameData;
|
|
|
- $amountData = array_unique($amount);
|
|
|
- sort($amountData);
|
|
|
- $result['amount'] = $amountData;
|
|
|
-
|
|
|
- foreach (array_unique($card_types) as $card_type) {
|
|
|
- $card_typeData[$card_type] = $this->scard_type($card_type);
|
|
|
- }
|
|
|
- ksort($card_typeData);
|
|
|
- $result['card_type'] = $card_typeData;
|
|
|
-
|
|
|
- $quality_txt = [1=>'普充', 2=>'快充', 3=>'卡密', 4=>'三方', 5=>'慢充'];
|
|
|
- foreach (array_unique($qualitys) as $quality) {
|
|
|
- $qualityData[$quality] = $quality_txt[$quality];
|
|
|
- }
|
|
|
- ksort($qualityData);
|
|
|
- $result['quality'] = $qualityData;
|
|
|
- echo(json_encode($result));
|
|
|
- exit;
|
|
|
- }
|
|
|
}
|