ayHaru 4 gadi atpakaļ
vecāks
revīzija
4ed27e10ac

+ 2 - 48
admin/control/merchant.php

@@ -640,7 +640,6 @@ class merchantControl extends SystemControl
                 showMessage('操作失败', 'index.php?act=merchant&op=refill_evidence');
             }
         } else {
-
             Tpl::showpage('recharge.manual.add');
         }
     }
@@ -1357,59 +1356,14 @@ class merchantControl extends SystemControl
         $condition['refill_order.inner_status'] = 0;
         $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
         $condition['vr_order.order_state'] = ORDER_STATE_SEND;
-        if (!empty($_GET['order_sn'])) {
-            $condition['refill_order.order_sn'] = $_GET['order_sn'];
-        }
-        if (!empty($_GET['mch_order'])) {
-            $condition['refill_order.mch_order'] = $_GET['mch_order'];
-        }
-        if (!empty($_GET['mchid'])) {
-            $condition['refill_order.mchid'] = $_GET['mchid'];
-        }
-        if (!empty($_GET['channel_name'])) {
-            $condition['refill_order.channel_name'] = $_GET['channel_name'];
-        }
-        if (!empty($_GET['store_id'])) {
-            $condition['vr_order.store_id'] = $_GET['store_id'];
-        }
-        if (!empty($_GET['card_type'])) {
-            if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
-                $condition['refill_order.card_type'] = $_GET['card_type'];
-            }
-            if($_GET['card_type'] == 'oil') {
-                $condition['refill_order.card_type'] = ['in' , ['1' , '2']];
-            }
-            if($_GET['card_type'] == 'phone') {
-                $condition['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
-            }
-        }
-        if (!empty($_GET['ch_trade_no'])) {
-            $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
-        }
-        if (!empty($_GET['card_no'])) {
-            $condition['refill_order.card_no'] = $_GET['card_no'];
-        }
-        if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
-            $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
-        }
-        $start_unixtime = strtotime($_GET['query_start_time']);
-        $end_unixtime = strtotime($_GET['query_end_time']);
 
-        if ($start_unixtime >0 && $end_unixtime >0) {
-            $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
-        }
-        if($_GET['time'] == 1){
-            $condition['refill_order.order_time'] = ['between', [(time() - 600) , (time() - 180)]];
-        }
-        if($_GET['time'] == 2){
-            $condition['refill_order.order_time'] = ['lt', (time() - 600)];
-        }
+        $condition['refill_order.order_time'] = ['lt', (time() - 180)];
         $merchant_list = Model('')->table('merchant')->limit(1000)->select();
         foreach ($merchant_list as $key =>$value) {
             $merchants[$value['mchid']] = $value;
         }
 
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 1000, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
 
         $stat = Model('')->table('refill_order,vr_order')->join('inner')
             ->on('refill_order.order_id=vr_order.order_id')

+ 6 - 3
admin/templates/default/merchant.index.php

@@ -101,9 +101,12 @@
                                 <a href="index.php?act=merchant&op=changeState&state=1&mchid=<?php echo $v['mchid'] ?>">启用机构</a>
                             <?php }?>
                             |
-                            <a href="index.php?act=merchant&op=price&quality=1&mchid=<?php echo $v['mchid'] ?>">普通通道费率设置</a>
-                            |
-                            <a href="index.php?act=merchant&op=price&quality=2&mchid=<?php echo $v['mchid'] ?>">快速通道费率设置</a>
+                            <a href="index.php?act=merchant&op=recharge_manual&mchid=<?php echo $v['mchid'] ?>">加款</a>
+                            <span style="display: block">
+                                <a href="index.php?act=merchant&op=price&quality=1&mchid=<?php echo $v['mchid'] ?>">普通通道设置</a>
+                                |
+                                <a href="index.php?act=merchant&op=price&quality=2&mchid=<?php echo $v['mchid'] ?>">快速通道设置</a>
+                            </span>
                         </td>
                     </tr>
                 <?php } ?>

+ 0 - 1
admin/templates/default/merchant.refill.evidence_list.php

@@ -6,7 +6,6 @@
             <h3>充值申请</h3>
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current" class="current"><span>充值申请</span></a></li>
-                <li><a href="index.php?act=merchant&op=recharge_manual"><span>手动预存</span></a></li>
             </ul>
         </div>
     </div>

+ 4 - 3
admin/templates/default/recharge.manual.add.php

@@ -5,7 +5,9 @@
     <div class="item-title">
       <h3>预存款</h3>
       <ul class="tab-base">
-          <li><a href="index.php?act=merchant&op=refill_evidence"><span>充值申请</span></a></li>
+          <li><a href="index.php?act=merchant&op=merchant" ><span><?php echo $lang['nc_manage'] ?></span></a></li>
+          <li><a href="index.php?act=merchant&op=merchant_add"><span><?php echo $lang['nc_new'] ?></span></a></li>
+          <li><a href="index.php?act=merchant&op=orderStorge"><span>机构库存锁定</span></a></li>
         <li><a href="JavaScript:void(0);"  class="current"><span>手动预存</span></a></li>
       </ul>
     </div>
@@ -21,8 +23,7 @@
         </tr>
         <tr class="noborder">
           <td class="vatop rowform">
-            <input type="text" name="mch_id" id="mch_id" class="txt" value="">
-<!--            <input type="text" name="apply_id" id="apply_id" class="txt" value="--><?php //echo $output['apply_id'];?><!--" onchange="javascript:checkevidence();">-->
+            <input type="text" name="mch_id" id="mch_id" class="txt" value="<?php echo $_GET['mchid']?>" readonly>
           <td class="vatop tips"></td>
         </tr>
         <tr class="noborder">

+ 1 - 138
admin/templates/default/refill.order.send.index.php

@@ -6,150 +6,13 @@
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
-            <h3>订单列表</h3>
+            <h3>订单监控列表</h3>
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current"><span>管理</span></a></li>
             </ul>
         </div>
     </div>
     <div class="fixed-empty"></div>
-    <form method="get" action="index.php" name="formSearch" id="formSearch">
-        <input type="hidden" name="act" value="merchant"/>
-        <input type="hidden" name="op" value="OrderSendList"/>
-        <table class="tb-type1 noborder search">
-            <tbody>
-            <tr>
-                <th><label>我方订单号</label></th>
-                <td><input class="txt2" type="text" name="order_sn" value="<?php echo $_GET['order_sn']; ?>"/></td>
-                <th><label>客户订单号</label></th>
-                <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
-                <th><label>供方订单号</label></th>
-                <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
-
-            </tr>
-            <tr>
-                <th><label>客户名称</label></th>
-                <td><input class="txt2" type="text" name="mchid" value="<?php echo $_GET['mchid']; ?>"/></td>
-                <th><label>供方名称</label></th>
-                <td>
-                    <select name="store_id" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php foreach($output['provider_list'] as $provider){?>
-                            <option value="<?php echo $provider['store_id']?>"
-                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>><?php echo $provider['name']?>
-                            </option>
-                        <?php }?>
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <th><label>充值卡卡号</label></th>
-                <td><input class="txt2" type="text" name="card_no" value="<?php echo $_GET['card_no']; ?>"/></td>
-            </tr>
-            <tr>
-
-                <th><label for="query_start_time">下单时间</label></th>
-                <td>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                        id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
-                    <label for="query_start_time">~</label>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" /></td>
-                <th><label>充值类型</label></th>
-                <td>
-                    <select name="card_type" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="1"
-                                <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
-                        <option value="2"
-                                <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
-                        <option value="4"
-                                <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
-                        <option value="5"
-                                <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
-                        <option value="6"
-                                <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
-                        <option value="oil"
-                                <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
-                        <option value="phone"
-                                <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费</option>
-                    </select>
-                </td>
-                <th><label>交易面额</label></th>
-                <td>
-                    <select name="refill_amount" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="10"
-                                <?php if ($_GET['refill_amount'] == '10'){ ?>selected<?php } ?>>10</option>
-                        <option value="20"
-                                <?php if ($_GET['refill_amount'] == '20'){ ?>selected<?php } ?>>20</option>
-                        <option value="30"
-                                <?php if ($_GET['refill_amount'] == '30'){ ?>selected<?php } ?>>30</option>
-                        <option value="50"
-                                <?php if ($_GET['refill_amount'] == '50'){ ?>selected<?php } ?>>50</option>
-                        <option value="100"
-                                <?php if ($_GET['refill_amount'] == '100'){ ?>selected<?php } ?>>100</option>
-                        <option value="200"
-                                <?php if ($_GET['refill_amount'] == '200'){ ?>selected<?php } ?>>200</option>
-                        <option value="300"
-                                <?php if ($_GET['refill_amount'] == '300'){ ?>selected<?php } ?>>300</option>
-                        <option value="500"
-                                <?php if ($_GET['refill_amount'] == '500'){ ?>selected<?php } ?>>500</option>
-                        <option value="1000"
-                                <?php if ($_GET['refill_amount'] == '1000'){ ?>selected<?php } ?>>1000</option>
-                        <option value="2000"
-                                <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
-                    </select>
-                <label>充值耗时</label>
-                    <select name="time" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="1"
-                                <?php if ($_GET['time'] == '1'){ ?>selected<?php } ?>>耗时3分钟</option>
-                        <option value="2"
-                                <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时5分钟</option>
-                    </select>
-                </td>
-                <td>
-                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
-                    </a>
-                </td>
-            </tr>
-            <tr>
-                <td></td>
-                <td>
-                    <a href="#" class="btns" onclick="hCopyChannel(event)">
-                        <span><i class="icon-edit"></i>拷贝供方单号</span>
-                    </a>
-                    <a href="#" class="btns" onclick="hCopyCardNo(event)">
-                        <span><i class="icon-edit"></i>拷贝充值卡号</span>
-                    </a>
-                </td>
-            </tr>
-            </tbody>
-        </table>
-    </form>
-      <table class="table tb-type2" id="prompt">
-        <tbody>
-          <tr class="space odd">
-            <th colspan="12"><div class="title"><h5>
-    金额统计</h5><span class="arrow"></span></div></th>
-          </tr>
-          <tr>
-            <td>
-                <ul>
-                    <li>总计充值金额:<?php echo $output['stat']['refill_amounts'] ?? 0?></li>
-                    <li>总计供方扣款金额:<?php echo $output['stat']['channel_amounts'] ?? 0?></li>
-                    <li>总计客户扣款金额:<?php echo $output['stat']['mch_amounts'] ?? 0?></li>
-                    <li>总计利润:<?php echo ncPriceFormat($output['stat']['mch_amounts'] - $output['stat']['channel_amounts'])?></li>
-                    <li>总计订单数量:<?php echo $output['stat']['order_count'] ?? 0?></li>
-                    <li>超过3分钟订单数量:<?php echo $output['count']['exceed_three'] ?? 0?></li>
-                    <li>超过5分钟订单数量:<?php echo $output['count']['exceed_five'] ?? 0?></li>
-                </ul>
-            </td>
-          </tr>
-        </tbody>
-      </table>
     <table class="table tb-type2 nobdb">
         <thead>
         <tr class="thead">

+ 2 - 1
helper/fcgisrv/MobileServer.php

@@ -74,7 +74,8 @@ class MobileServer extends BaseServer
             if(file_exists($file))
             {
                 if(defined('CROSS_DOAMIN') && CROSS_DOAMIN == true) {
-                    $host = 'http://localhost:3333';
+                    $host = 'http://192.168.1.130:3333';
+                    fcgi_header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding");
                     fcgi_header("Content-Type: text/html; charset=UTF-8");
                     fcgi_header("Access-Control-Allow-Credentials: true");
                     fcgi_header("Access-Control-Allow-Origin: {$host}");

+ 78 - 0
mobile/control/merchant_info.php

@@ -436,4 +436,82 @@ class merchant_infoControl extends mbMerchantControl
         }
         return $data;
     }
+
+    public function pdlogexportOp()
+    {
+        $mchid = $this->mchid();
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
+        if (!$merchant_info) {
+            return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
+        }
+
+
+        $condition['lg_member_id'] = $merchant_info['admin_id'];
+        if (!empty($_GET['lg_type'])) {
+            $condition['lg_type'] = $_GET['lg_type'];
+        }
+        if ($_GET['start_time'] && $_GET['end_time']) {
+            $condition['lg_add_time'] = ['between', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        $list = Model('')->table('pd_log,refill_order')->join('left')
+            ->on('pd_log.lg_order_sn=refill_order.order_sn')
+            ->field('pd_log.lg_type,pd_log.lg_av_amount,pd_log.lg_add_time,refill_order.card_no,refill_order.mchid,refill_order.card_type,pd_log.lg_available,refill_order.refill_amount')
+            ->where($condition)->select();
+        $result = $this->export_pdlog_exec($list);
+        return self::outsuccess($result);
+    }
+
+    private function export_pdlog_exec($list)
+    {
+        $title = [
+            ['value' => '代理商账号'],
+            ['value' => '金额'],
+            ['value' => '账户余额'],
+            ['value' => '交易日期'],
+            ['value' => '类型'],
+            ['value' => '备注']
+        ];
+        $mchid = $this->mchid();
+        $card_type = ['1'=>'中石油' , '2' =>'中石化' , '4' => '移动' , '5' => '联通' , '6' => '电信'];
+        foreach ($list as $value) {
+            if (isset($value['lg_add_time'])) {
+                $value['lg_add_time'] = date('Y-m-d H:i:s', $value['lg_add_time']);
+            }
+            switch ($value['lg_type']) {
+                case 'order_pay':
+                    $value['lg_type_text'] = '消费';
+                    break;
+                case 'order_cancel':
+                    $value['lg_type_text'] = '退款';
+                    break;
+                case 'recharge':
+                    $value['lg_type_text'] = '充值';
+                    break;
+                case 'sys_add_money':
+                    $value['lg_type_text'] = '管理员充值【增加】';
+                    break;
+                case 'sys_del_money':
+                    $value['lg_type_text'] = '管理员减款';
+                    break;
+                default:
+                    $value['lg_type_text'] = '';
+                    break;
+            }
+            $data = [];
+            $str = "{$value['card_no']}-{$card_type[$value['card_type']]}{$value['refill_amount']}元";
+            if(empty($value['card_no']) || empty($value['card_type']) || empty($value['refill_amount'])) {
+                $str = '';
+            }
+            $data[] = ['value' => $mchid];
+            $data[] = ['value' => $value['lg_av_amount']];
+            $data[] = ['value' => ncPriceFormat($value['lg_available'] + $value['lg_av_amount'])];
+            $data[] = ['value' => $value['lg_add_time']];
+            $data[] = ['value' => $value['lg_type_text']];
+            $data[] = ['value' => $str];
+            $datas[] = $data;
+        }
+        Log::record(json_encode($datas),Log::DEBUG);
+        return ['title' => $title , 'data' => $datas];
+    }
 }

+ 87 - 5
mobile/control/merchant_order.php

@@ -114,11 +114,8 @@ class merchant_orderControl extends mbMerchantControl
             if (isset($order['notify_time'])) {
                 $order['notify_time'] = date('Y-m-d H:i:s', $order['notify_time']);
             }
-            if($order['channel_name'] != 'bjb') {
-                $order['ch_trade_no'] = '';
-            }
-            if($order['ying'] == 1) {
-                $order['order_state'] = 'retrying';
+            if($order['is_retrying'] == 1) {
+                $order['order_state'] = ORDER_STATE_SEND;
             }
             if ($order['order_state'] == ORDER_STATE_NEW || $order['order_state'] == ORDER_STATE_PAY) {
                 $order['order_state'] = ORDER_STATE_SEND;
@@ -202,4 +199,89 @@ class merchant_orderControl extends mbMerchantControl
         }
         return $result;
     }
+
+    public function OrderExportOp()
+    {
+        $model_vr_order = Model('refill_order');
+
+        $cond['mchid'] = $this->mchid();
+        $cond['inner_status'] = 0;
+        if (!empty($_GET['card_type'])) {
+            if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
+                $cond['refill_order.card_type'] = $_GET['card_type'];
+            }
+            if($_GET['card_type'] == 'oil') {
+                $cond['refill_order.card_type'] = ['in' , ['1' , '2']];
+            }
+            if($_GET['card_type'] == 'phone') {
+                $cond['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
+            }
+        }
+        if (!empty($_GET['card_no'])) {
+            $cond['refill_order.card_no'] = $_GET['card_no'];
+        }
+        if (!empty($_GET['refill_amount'])) {
+            $cond['refill_order.refill_amount'] = $_GET['refill_amount'];
+        }
+        if (!empty($_GET['mch_order'])) {
+            $cond['refill_order.mch_order'] = $_GET['mch_order'];
+        }
+        if (!empty($_GET['order_sn'])) {
+            $cond['refill_order.order_sn'] = $_GET['order_sn'];
+        }
+        if (in_array($_GET['order_state'], array('0', '30', '40'))) {
+            $cond['vr_order.order_state'] = $_GET['order_state'];
+            if($_GET['order_state'] == 30 && $_GET['time'] == 1){
+                $cond['refill_order.order_time'] = ['lt', (time() - 3600)];
+            }
+        }
+        if ($_GET['start_time'] > 0 && $_GET['end_time'] > 0) {
+            $cond['refill_order.order_time'] = ['time', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        $fields = 'refill_order.*,vr_order.order_state';
+        $order_list = $model_vr_order->getMerchantOrderList($cond, '10000', $fields, 'refill_order.order_id desc');
+        $order_list = $this->merchant_order_format($order_list);
+
+        $result = $this->export_order_exec($order_list);
+        return self::outsuccess($result);
+    }
+
+    private function export_order_exec($order_list)
+    {
+        $title = [
+            ['value' => '代理商账号'],
+            ['value' => '商品名称'],
+            ['value' => '交易账号'],
+            ['value' => '交易金额'],
+            ['value' => '交易面值'],
+            ['value' => '交易日期'],
+            ['value' => '交易状态'],
+            ['value' => '处理时间'],
+            ['value' => '第三方流水']
+        ];
+        $card_type = ['1'=>'中石油' , '2' =>'中石化' , '4' => '移动' , '5' => '联通' , '6' => '电信'];
+        foreach ($order_list as $order) {
+            $data = [];
+            $official_sn = $order['official_sn'];
+            $notify_time = $order['$notify_time'];
+            if(empty($order['official_sn'])) {
+                $official_sn = '';
+            }
+            if(empty($order['$notify_time'])) {
+                $notify_time = '';
+            }
+            $data[] = ['value' => $order['mchid']];
+            $data[] = ['value' => "{$card_type[$order['card_type']]}{$order['refill_amount']}元"];
+            $data[] = ['value' => $order['card_no']];
+            $data[] = ['value' => $order['mch_amount']];
+            $data[] = ['value' => $order['refill_amount']];
+            $data[] = ['value' => $order['order_time']];
+            $data[] = ['value' => $order['order_state_text']];
+            $data[] = ['value' => $notify_time];
+            $data[] = ['value' => $official_sn];
+            $datas[] = $data;
+        }
+        Log::record(json_encode($datas),Log::DEBUG);
+        return ['title' => $title , 'data' => $datas];
+    }
 }