瀏覽代碼

独立站查看超时订单

lvhao 3 月之前
父節點
當前提交
d81d4e03a3

+ 4 - 0
core/CoreApp/controllers/Fullorder.php

@@ -50,6 +50,7 @@ class Fullorder extends Start_Controller {
 		$this->load->_model('Model_message','message');
 		$this->load->_model("Model_logic_order","logic_order");
 		$this->load->_model("Model_logic_ding","logic_ding");
+		$this->load->_model("Model_fullordererrors","fullordererrors");
 	}
 	//定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
@@ -465,6 +466,7 @@ class Fullorder extends Start_Controller {
 		    {
                 $start = ($page - 1)*$perpage;
             }
+			
             //取得信息列表id,shop,type,source,user,orderinfo,number,name,state,buytime,clientremarks,review,print,library,libraryconfirm,express,waybill,orderremarks,black
             $info_list = $this->fullorder->find_all($where,'id,shop,type,orderinfo,number,sname,email,state,buytime,review,libraryconfirm,express,waybill,orderremarks,library,black,clientremarks',$order_str,$start,$perpage);
 			 //格式化数据
@@ -755,6 +757,8 @@ class Fullorder extends Start_Controller {
 		$this->data['fullorderexcel'] = $fullorderexcel;
 		$error = $this->fullorder->find_count("failed !='' and mergeid = 0 and print != 3 and (".rtrim($fgshop,'or').") and dtime > '".(time()-90*24*3600)."'");
 		$this->data['error'] = $error;
+		$cs_num = $this->fullordererrors->find_count( " error_type = 1 and (".rtrim($fgshop,'or'). " ) and error_time > '".(time()-90*24*3600)."'");
+		$this->data['cs_num'] = $cs_num;
 		$this->data['power'] = $vip;
 		$this->_Template('fullorder',$this->data);
 	}

+ 116 - 0
core/CoreApp/controllers/Fullordererror.php

@@ -0,0 +1,116 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+class Fullordererror extends Start_Controller {
+	public function __construct(){
+		parent::__construct();
+		$this->load->library('session');
+		$this->load->_model('Model_message','message');
+		$this->load->_model('Model_shop','shop');
+		$this->load->_model("Model_fullordererrors","fullordererrors");
+	}
+	//定义方法的调用规则 获取URI第二段值
+    public function _remap($arg,$arg_array)
+    {
+		if($arg == 'outtime')//添加
+        {
+             $this->_outtime();
+        }
+		else
+		{
+			 $this->_index();
+		}
+    }
+	public function _index(){
+
+	}
+	public function _outtime(){
+		if(isset($_SESSION['api']))
+		{
+			$user = $this->user->get_api($_SESSION['api']);
+			$usp = $user;
+		    $fgshop = "";$sid = "";
+		    $user = explode('|',trim($user['shop'],'|'));
+			foreach ($user as $value) 
+		    {
+				$fgshop .= " shop = ".$value." or";
+				$sid .= " id = ".$value." or";
+			}
+		}
+		$post = $this->input->post(NULL, TRUE);
+		if(isset($post['page']))
+		{
+		    $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+
+			$number = $this->input->post('number',true);
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+			$where = "error_type = 1 and (".rtrim($fgshop,'or').")";
+			
+			if($number)
+            {
+                $where  .= " and number = '$number'";
+            }
+			if($timetk && $timetj)
+            {
+				$timetj = $timetj+24*3600;
+                $where  .= " and dtime > '$timetk' and dtime < '$timetj'";
+            }
+            //数据排序
+            $order_str = "id desc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+            $info_list = $this->fullordererrors->find_all($where,'id,shop,number,error_time',$order_str,$start,$perpage);
+			 //格式化数据
+            foreach ($info_list as $key=>$value) 
+		    {
+				//$ud = $this->fullorder->read($value['id']);
+				$shop = $this->shop->read($value['shop']);
+				$info_list[$key]['shop'] = $shop['shopname'];
+				// $info_list[$key]['orderinfo'] = "<h9 class='window' data-h='/fullorder/edit/".$value['id']."' data-t='订单号:".$value['orderinfo']."'>".$value['orderinfo']."<p>";
+				// $warehouse = $this->warehouse->read($value['type']);
+				// $warehousetitle = $warehouse['title'];
+				// if($value['type'] != 1){$warehousetitle = "<font style='color:#f64b4b'>".$warehouse['title']."</font>";}
+				// $info_list[$key]['type'] = $warehousetitle;
+				// if($value['express'] != 0)
+				// {
+				//     $express = $this->express->read($value['express']);
+				// 	$expressservicename = $express['servicename'];
+				// if($value['express'] != 1){$expressservicename = "<font style='color:#f64b4b'>".$express['servicename']."</font>";}
+				//     $info_list[$key]['express'] = $expressservicename;
+				// }
+				// else
+				// {
+				// 	$info_list[$key]['express'] = "无";
+				// }
+				// $x = "";
+				// if($ud['review'] >4 && $ud['print'] == 1)
+				// {
+				//     $x = "<p class='ckn'><b class='fojzof' data-type='8' data-id='".$value['id']."'>允许打印</b></p>";
+				// }
+				// else
+				// {
+				// 	$x = "<p class='ckn'><b class='fojzof' data-type='9' data-id='".$value['id']."'>关闭</b></p>";
+				// }
+				// $info_list[$key]['operation'] = $x;
+            }
+		    $total = $this->fullordererrors->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
+		    echo json_encode($rows);exit;
+		}
+		$wlshop = $this->shop->find_all('1=1 and '.rtrim($sid,'or'));
+		$this->data['wlshop'] = $wlshop;
+		$this->_Template('fullordererror_errshow',$this->data);
+	}
+
+}

+ 5 - 0
template/erp/fullorder.html

@@ -149,6 +149,11 @@
 {if $error > 0}
 <a href="/fullorder/error/" style="background-color:#F00">异常打印订单({$error})</a>
 {/if}
+
+
+{if $cs_num > 0}
+<a href="/fullordererror/outtime/" style="background-color:#33CCFF">超时打印订单({$cs_num })</a>
+{/if}
 {if $power ==1}<a href="javascript:void(0);" class="dcdxyz">导出多运单号订单</a>
 <a href="javascript:void(0);" class="thxz">导出退货订单</a>
 {/if}

+ 52 - 0
template/erp/fullordererror_errshow.html

@@ -0,0 +1,52 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<ul class="search">
+<li>
+店铺名称:<select name="shop" class="select">
+<option value="">请选择</option>
+{loop usershop() as $val}
+<option value="{$val['id']}">{$val['shopname']}</option>
+{/loop}</select>
+</li>
+<li>
+
+
+<li>编号:<input value="" name="number" type="text" ></li>
+
+<!-- <li>订单时间:<input id="timetk"  value="{date('Y-m-d',time()-30*24*3600)}" name="timetk" type="text" >
+至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time())}" name="timetj" type="text" ></li>
+-->
+<li><span>确 定</span></li>
+</ul>
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>店铺名称</td>
+<td>编号</td>
+
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<script>
+var dataurl = "/fullordererror/outtime/";;
+$(document).ready(function() {
+$("#timetk").calendar();$("#timetj").calendar();
+});
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+$(this).find('td:eq(0)').css("width","1%");
+$(this).find('td:eq(1)').css("width","8%");
+$(this).find('td:eq(2)').css("width","8%");
+
+});}
+</script>
+<script type="text/javascript" src="{$theme}js/time.js"></script>
+
+{Template footer}