فهرست منبع

Merge branch 'forder' of 39.97.239.116:gyfl/xyzshop into forder

stanley-king 3 سال پیش
والد
کامیت
b267426669

+ 8 - 2
data/model/fetch_order.model.php

@@ -64,10 +64,16 @@ class fetch_orderModel extends Model
     }
 
     //处理完成的单子
-    public function processed($fetch_id,$fetch_result,$official_sn = '')
+    public function processed($fetch_id,$fetch_result,$official_sn = '',$voucher = '')
     {
         return $this->where(['fetch_id' => $fetch_id,'fetch_status' => self::FETCH_ORDER_PROCESSING])
-                    ->update(['fetch_status' => self::FETCH_ORDER_PROCESSED,'finsh_time' => time(),'fetch_result' => $fetch_result,'official_sn' => $official_sn]);
+                    ->update([
+                        'fetch_status' => self::FETCH_ORDER_PROCESSED,
+                        'finsh_time' => time(),
+                        'fetch_result' => $fetch_result,
+                        'official_sn' => $official_sn,
+                        'voucher' => $voucher
+                    ]);
     }
 
     //超时未处理订单,不可以再接单.

+ 15 - 2
shop/control/store_refill_order.php

@@ -59,7 +59,7 @@ class store_refill_ordercontrol extends BaseSellerControl
 
         $res = $mod->fetch($store_id, $member_id, $card_type, $num);
         if(!empty($res)) {
-            showDialog('抢单成功','index.php?act=store_refill_order&op=index','succ');
+            showDialog('抢单成功',"index.php?act=store_refill_order&op=index&card_type={$card_type}&num={$num}",'succ');
         } else {
             showDialog('抢单失败','index.php?act=store_refill_order&op=index','error');
         }
@@ -104,11 +104,24 @@ class store_refill_ordercontrol extends BaseSellerControl
         $fetch_order = $mod->order_info(['fetch_id' => $fetch_id],'*',true);
 
         if (!empty($fetch_order)) {
+            $voucher = '';
+            if(!empty($_FILES['voucher']['name'])) {
+                $upload = new UploadFile();
+                $upload->set('default_dir',ATTACH_UPFILE.'/shop');
+
+                $result = $upload->upfile('voucher');
+                if ($result){
+                    $voucher = $upload->file_name;
+                }else {
+                    showDialog($upload->error);
+                }
+            }
+
             $params = ['state' => $state_type,
                 'order_sn' => $fetch_order['order_sn'],
                 'official_sn' => $official_sn];
             Log::record("state: {$state_type}, order_sn: {$fetch_order['order_sn']}, official_sn: {$official_sn}", Log::DEBUG);
-            $mod->processed($fetch_id,$state_type,$official_sn);
+            $mod->processed($fetch_id,$state_type,$official_sn,$voucher);
             refill\util::push_notify($fetch_order['channel_name'],$params);
             showDialog("成功", 'reload', 'js');
             exit();

+ 2 - 2
shop/templates/default/layout/seller_layout.php

@@ -149,8 +149,8 @@ catch(e){}
       </div>
     </div>
   </div>
-  <div id="layoutRight" class="ncsc-layout-right">
-    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i><?php echo $output['current_menu']['model_name'];?><i class="icon-angle-right"></i><?php echo $output['current_menu']['name'];?></div>
+  <div id="layoutRight" class="ncsc-layout-right div-right">
+    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right "></i><?php echo $output['current_menu']['model_name'];?><i class="icon-angle-right"></i><?php echo $output['current_menu']['name'];?></div>
     <div class="main-content" id="mainContent">
       <?php require_once($tpl_file); ?>
     </div>

+ 18 - 2
shop/templates/default/seller/store_refill_order.batch_dispose.php

@@ -1,9 +1,25 @@
+<style>
+    .wrapper {
+    width: 1855px;
+    margin: auto;
+}
+.ncsc-layout-right {
+    background-color: #FFF;
+    width: 89%;
+    min-height: 640px;
+    float: right;
+    position: relative;
+    z-index: 1;
+}
+</style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
+
+
 <div class="tabmenu">
     <ul class="tab pngFix">
         <li class="normal"><a target="" href="<?php echo urlShop('store_refill_order', 'index'); ?>">待处理订单</a></li>
-        <li class="active"><a target="" href="<?php echo urlShop('store_refill_order', 'fetch_list'); ?>">处理待处理订单</a>
+        <li class="active"><a target="" href="<?php echo urlShop('store_refill_order', 'fetch_list'); ?>">已完成订单</a>
         </li>
     </ul>
 </div>
@@ -31,7 +47,7 @@
         <td class="bdl"><?php echo $order['card_no']; ?></td>
         <td class="bdl"><?php echo $order['refill_amount']; ?></td>
         <td class="bdl"><?php echo $order['official_sn'] ?? '/'; ?></td>
-        <td class="bdl"><?php echo $order['notify_state']; ?></td>
+        <td class="bdl"><?php echo $order['fetch_result']; ?></td>
     </tr>
     <?php }
     } else { ?>

+ 76 - 20
shop/templates/default/seller/store_refill_order.index.php

@@ -42,7 +42,18 @@ a:nth-child(3) {
     margin-right: 0px;
 
 }
-
+.wrapper {
+    width: 1855px;
+    margin: auto;
+}
+.ncsc-layout-right {
+    background-color: #FFF;
+    width: 89%;
+    min-height: 640px;
+    float: right;
+    position: relative;
+    z-index: 1;
+}
 </style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
@@ -61,28 +72,21 @@ a:nth-child(3) {
     <div>
     <select name="" id="tabmenuright" class="tabmenuright">
         <option value="0">卡类型</option>
-        <option value="<?php echo mtopcard\PetroChinaCard;?>">中石油</option>
-        <option value="<?php echo mtopcard\SinopecCard;?>">中石化</option>
-        <option value="<?php echo mtopcard\ChinaMobileCard;?>">中国移动</option>
-        <option value="<?php echo mtopcard\ChinaUnicomCard;?>">中国联通</option>
-        <option value="<?php echo mtopcard\ChinaTelecomCard;?>">中国电信</option>
+        <option value="<?php echo mtopcard\PetroChinaCard;?>" <?php if($_GET['card_type'] == mtopcard\PetroChinaCard){ echo 'selected';}?>>中石油</option>
+        <option value="<?php echo mtopcard\SinopecCard;?>" <?php if($_GET['card_type'] == mtopcard\SinopecCard){ echo 'selected';}?>>中石化</option>
+        <option value="<?php echo mtopcard\ChinaMobileCard;?>" <?php if($_GET['card_type'] == mtopcard\ChinaMobileCard){ echo 'selected';}?>>中国移动</option>
+        <option value="<?php echo mtopcard\ChinaUnicomCard;?>" <?php if($_GET['card_type'] == mtopcard\ChinaUnicomCard){ echo 'selected';}?>>中国联通</option>
+        <option value="<?php echo mtopcard\ChinaTelecomCard;?>" <?php if($_GET['card_type'] == mtopcard\ChinaTelecomCard){ echo 'selected';}?>>中国电信</option>
         </select>
-    <span>前方共有<span class="rob"><?php echo $output['total_fetch_order'];?></span>笔订单可抢</span>
+    <span>前方共有<span class="rob"></span>笔订单可抢</span>
     </div>
   <div class="flex">
         <p class="flexleft">抢</p>
         <select name="" id="queryrob" class="querySelect">
         <option value="0">请选择</option>
-        <option value="1">1</option>
-        <option value="2">2</option>
-        <option value="3">3</option>
-        <option value="4">4</option>
-        <option value="5">5</option>
-        <option value="6">6</option>
-        <option value="7">7</option>
-        <option value="8">8</option>
-        <option value="9">9</option>
-        <option value="10">10</option>
+            <?php for($i = 1; $i < 11; $i++){?>
+        <option value="<?php echo $i;?>" <?php if($_GET['num'] == $i){ echo 'selected';}?>><?php echo $i;?></option>
+            <?php }?>
         </select>
         <p class="flexright">单</p>
  
@@ -97,7 +101,10 @@ a:nth-child(3) {
         <th class="w150">订单编号</th>
         <th class="w150">充值卡号</th>
         <th class="w80">充值面额</th>
+        <th class="w150">下单时间</th>
+        <th class="w150">接单时间</th>
         <th class="w150">第三方单号填写</th>
+<!--        <th class="w150">凭证上传</th>-->
         <th class="w180">交易操作</th>
     </tr>
     </thead>
@@ -109,7 +116,17 @@ a:nth-child(3) {
                 <td><?php echo $order['order_sn']; ?></td>
                 <td class="bdl"><?php echo $order['card_no']; ?></td>
                 <td class="bdl"><?php echo $order['refill_amount']; ?></td>
+                <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['add_time']);?></td>
+                <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['fetch_time']);?></td>
                 <td class="bdl"><input type="text" name="ch_trade_no" style="width: 180px" id="ch_trade_no" /></td>
+<!--                <td class="bdl">-->
+<!--                <form action="" id="imageForm" method="post">-->
+<!---->
+<!--                <input type="hidden" name="voucher" value="提交">               -->
+<!--                </form>-->
+<!---->
+<!---->
+<!--                </td>-->
                 <td class="bdl bdr">
                     <a href="#" class="ncsc-btn-mini" id="order_action_success" data-order="SUCCESS" onclick="change_state(event,<?php echo $order['fetch_id']; ?>)">处理成功</a>
                     <a href="#" class="ncsc-btn-mini" id="order_action_cancel"  data-order="CANCEL" onclick="change_state(event,<?php echo $order['fetch_id']; ?>)">处理失败</a>
@@ -136,6 +153,21 @@ a:nth-child(3) {
  <!-- <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/> -->
 <script>
     $(function () {
+        let value_robb = $('.tabmenuright').val()
+        
+
+    $.get('index.php?act=store_refill_order&op=fetch_count',{
+        card_type:value_robb
+    },function(data) {
+               data = JSON.parse(data)
+                console.log("默认",data);
+                if (data.code == 200) {
+                    const value_1 = data.count
+                    $('.rob').text(value_1)
+                } 
+                })
+
+                
             $('#tabmenuright').click(function() {
                     let value_rob = $(this).val()
                     let value_ro = $("#tabmenuright  option:selected").text()
@@ -150,6 +182,8 @@ a:nth-child(3) {
                 } 
                 })
         })
+
+
         //抢单
         $('#queryrob').click(() => {
             let value_rob = $("#tabmenuright").val()
@@ -172,11 +206,17 @@ a:nth-child(3) {
                 card_type:value_rob
             },function(data) {
                     data = JSON.parse(data)
-                
+                    const value_1 = data.count
+                    console.log("dang1", value_1);
+                    console.log("dang2", queryrob_val);
+                    let data_ro = value_1 - queryrob_val
+                    console.log("dang3",data_ro);
                 if (data.count == 0) {
                     layer.msg('暂无订单可抢');
                 } else if (value_rob != 0 && queryrob_val!= 0 && data.count!= 0) {
+                    $('.rob').text(data_ro)
                     window.location.href = `index.php?act=store_refill_order&op=fetch_order&num= ${queryrob_val}&card_type= ${value_rob}`
+                    console.log("nian", data.cound);
                 } else {
                     layer.msg('请选择卡类型以及单数');
                 }
@@ -202,6 +242,7 @@ a:nth-child(3) {
             let url = "index.php?act=store_refill_order&op=batch_dispose&form_submit=ok&fetch_id="+fetch_id;
             console.log(11111, url);
             let official_sn = e.currentTarget.parentElement.previousElementSibling.firstElementChild.value
+            console.log(official_sn);
             if (state_type == 'SUCCESS') {
                 official_sn = official_sn ? official_sn : ''
             } else {
@@ -214,8 +255,23 @@ a:nth-child(3) {
             }, function () {
 
             });
-
         }
     }
-    
+    // function imgChange(){
+    //         var  file=document.getElementById('files1')
+            
+    //         var imgsurl=URL.createObjectURL(file.files[0]);
+    //         // 开始上传
+    //         var formData = new FormData();
+
+    //         formData.append('file', file.files[0]);
+    //          $.ajax({
+    //         url: "index.php?act=store_refill_order&op=batch_dispose",
+    //         type: "POST",
+    //         voucher: formData,
+      
+    //     })
+
+    //     }
+ 
 </script>