|
@@ -71,10 +71,8 @@ class WigsOutCtrl{
|
|
|
if($type != 0){
|
|
|
$sql .= " AND `type`='{$type}' ";
|
|
|
}
|
|
|
-
|
|
|
$sql .= "ORDER BY `order_status` ASC,`in_time` DESC,`print_time` DESC LIMIT {$offset},$pnsn;";
|
|
|
$query = $this->db->querySql($sql);
|
|
|
-
|
|
|
$line = "";
|
|
|
while($item = $this->db->queryRs($query)) {
|
|
|
if($item['order_status'] == '2'){
|
|
@@ -97,6 +95,11 @@ class WigsOutCtrl{
|
|
|
$in_time = '暂无';
|
|
|
$out_time = '暂无';
|
|
|
$class = 'canceled';
|
|
|
+ }elseif($item['order_status'] == '6'){
|
|
|
+ $order_status = "未分配";
|
|
|
+ $in_time = '暂无';
|
|
|
+ $out_time = '暂无';
|
|
|
+ // $class = 'canceled';
|
|
|
}
|
|
|
if($item['gir'] == 1){
|
|
|
$repeat = 'repeat';
|
|
@@ -170,6 +173,11 @@ class WigsOutCtrl{
|
|
|
$in_time = $item['in_time'];
|
|
|
$out_time = $item['out_time'];
|
|
|
$class = 'ok2';
|
|
|
+ }elseif($item['order_status'] == '6'){
|
|
|
+ $order_status = "未分配";
|
|
|
+ $in_time = '暂无';
|
|
|
+ $out_time = '暂无';
|
|
|
+ // $class = 'canceled';
|
|
|
}
|
|
|
|
|
|
if($item['gir'] == 1){
|
|
@@ -231,7 +239,6 @@ class WigsOutCtrl{
|
|
|
'no' => '-10'
|
|
|
));
|
|
|
}
|
|
|
-
|
|
|
$now = date("Y-m-d H:i:s", time());
|
|
|
$sql = "UPDATE `app_wigsout` SET `order_status`='{$order_status}',`in_time`='{$now}',`out_time`='{$now}' WHERE `order_barcode`='{$code}' AND `order_status`!=4;";
|
|
|
if($arr_status[0]['order_status'] == 5 && $order_status == 2){
|
|
@@ -296,6 +303,28 @@ class WigsOutCtrl{
|
|
|
'no' => '-9',
|
|
|
'time' => $arr_status[0]['update_time'],
|
|
|
));
|
|
|
+ }elseif($arr_status[0]['order_status'] == 5 && $order_status == 6){
|
|
|
+ $this->db->querySql($sql);
|
|
|
+ if($this->db->queryAR() == 1){
|
|
|
+ return json_encode(array(
|
|
|
+ 'no' => '4'
|
|
|
+ ));
|
|
|
+ }else{
|
|
|
+ return json_encode(array(
|
|
|
+ 'no' => '-12'
|
|
|
+ ));
|
|
|
+ }
|
|
|
+ }elseif($arr_status[0]['order_status'] == 6 && $order_status == 2){
|
|
|
+ $this->db->querySql($sql);
|
|
|
+ if($this->db->queryAR() == 1){
|
|
|
+ return json_encode(array(
|
|
|
+ 'no' => '1'
|
|
|
+ ));
|
|
|
+ }else{
|
|
|
+ return json_encode(array(
|
|
|
+ 'no' => '-1'
|
|
|
+ ));
|
|
|
+ }
|
|
|
}else{
|
|
|
return json_encode(array(
|
|
|
'no' => '-11'
|
|
@@ -315,7 +344,7 @@ class WigsOutCtrl{
|
|
|
$search_time='print_time';
|
|
|
}else{
|
|
|
$search_time='print_date';
|
|
|
- }
|
|
|
+ }
|
|
|
$yesterday_start = date("Y-m-d", strtotime('-1 day')) . ' 00:00:00';
|
|
|
$yesterday_end = date("Y-m-d", strtotime('-1 day')) . ' 23:59:59';
|
|
|
$sql_yesterday = "SELECT COUNT(`oid`) AS `total_yesterday_out` FROM `app_wigsout`";
|
|
@@ -326,7 +355,6 @@ class WigsOutCtrl{
|
|
|
|
|
|
$sql_in = "SELECT COUNT(`oid`) AS `total_in` FROM `app_wigsout` ";
|
|
|
$sql_in .= "WHERE `{$search_time}` BETWEEN '{$startDate}' AND '{$endDate}' AND `order_status`='2';";
|
|
|
-
|
|
|
$sql_out = "SELECT COUNT(`oid`) AS `total_out` FROM `app_wigsout` ";
|
|
|
$sql_out .= "WHERE `{$search_time}` BETWEEN '{$startDate}' AND '{$endDate}' AND `order_status`='3';";
|
|
|
|
|
@@ -367,11 +395,12 @@ class WigsOutCtrl{
|
|
|
$shop = $this->common->my_filter_input($_GET['shop']);
|
|
|
$status = $this->common->my_filter_input($_GET['status']);
|
|
|
$type = $this->common->my_filter_input($_GET['type']);
|
|
|
- $time_type=isset($_GET['time_type'])?$this->common->my_filter_input($_GET['time_type']):1;
|
|
|
+ $time_type=isset($_GET['time_type'])?$this->common->my_filter_input($_GET['time_type']):1;
|
|
|
$startDate = $_GET['startDate'] . ' 00:00:00';
|
|
|
$endDate = $_GET['endDate'].' 23:59:59';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$shop_type = '';
|
|
|
switch($shop){
|
|
|
case 1:
|
|
@@ -397,11 +426,11 @@ class WigsOutCtrl{
|
|
|
}
|
|
|
$sql = 'SELECT `oid`,`order_barcode`,`order_status`,`goods_no`,`goods_info`,`out_time`,`in_time`,`print_time`,`print_date`,`transport` ';
|
|
|
$sql .= 'FROM `app_wigsout` ';
|
|
|
- if($time_type==1){
|
|
|
- $sql .= "WHERE `print_time` BETWEEN '{$startDate}' AND '{$endDate}' ";
|
|
|
- }else{
|
|
|
- $sql .= "WHERE `print_date` BETWEEN '{$startDate}' AND '{$endDate}' ";
|
|
|
- }
|
|
|
+ if($time_type==1){
|
|
|
+ $sql .= "WHERE `print_time` BETWEEN '{$startDate}' AND '{$endDate}' ";
|
|
|
+ }else{
|
|
|
+ $sql .= "WHERE `print_date` BETWEEN '{$startDate}' AND '{$endDate}' ";
|
|
|
+ }
|
|
|
|
|
|
if($shop != 0){
|
|
|
$sql .= " AND `order_barcode` LIKE '{$shop_type}%' ";
|
|
@@ -422,7 +451,7 @@ class WigsOutCtrl{
|
|
|
->setCellValue('E1', '物流方式')
|
|
|
->setCellValue('F1', '状态')
|
|
|
->setCellValue('G1', '成品仓打印日期')
|
|
|
- ->setCellValue('H1', '布条打印日期')
|
|
|
+ ->setCellValue('H1', '布条打印日期')
|
|
|
->setCellValue('I1', '入库日期')
|
|
|
->setCellValue('J1', '出库日期');
|
|
|
$k = 2;
|
|
@@ -432,7 +461,7 @@ class WigsOutCtrl{
|
|
|
$order_status = "已入库";
|
|
|
$in_time = $item['in_time'];
|
|
|
$out_time = '暂无';
|
|
|
- $print_date=$item['print_date'];
|
|
|
+ $print_date=$item['print_date'];
|
|
|
}elseif($item['order_status'] == '1'){
|
|
|
$order_status = "未出库";
|
|
|
$in_time = '暂无';
|
|
@@ -442,10 +471,14 @@ class WigsOutCtrl{
|
|
|
$in_time = $item['in_time'];
|
|
|
$out_time = $item['out_time'];
|
|
|
}elseif($item['order_status'] == '5'){
|
|
|
- $order_status = "未入库";
|
|
|
- $in_time = '暂无';
|
|
|
- $out_time = '暂无';
|
|
|
- }
|
|
|
+ $order_status = "未入库";
|
|
|
+ $in_time = '暂无';
|
|
|
+ $out_time = '暂无';
|
|
|
+ }elseif($item['order_status'] == '6'){
|
|
|
+ $order_status = "未分配";
|
|
|
+ $in_time = '暂无';
|
|
|
+ $out_time = '暂无';
|
|
|
+ }
|
|
|
$PHPExcel->setActiveSheetIndex(0)
|
|
|
->setCellValue('A'.$k, $k-1)
|
|
|
->setCellValue('B'.$k, $item['order_barcode'])
|
|
@@ -454,12 +487,11 @@ class WigsOutCtrl{
|
|
|
->setCellValue('E'.$k, $item['transport'])
|
|
|
->setCellValue('F'.$k, $order_status)
|
|
|
->setCellValue('G'.$k, $item['print_time'])
|
|
|
- ->setCellValue('H'.$k, $print_date)
|
|
|
+ ->setCellValue('H'.$k, $print_date)
|
|
|
->setCellValue('I'.$k, $in_time)
|
|
|
->setCellValue('J'.$k, $out_time);
|
|
|
$k++;
|
|
|
}
|
|
|
-
|
|
|
// set wdith
|
|
|
$PHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(5);
|
|
|
$PHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);
|