lvhao 3 giorni fa
parent
commit
fcea3dfff7
1 ha cambiato i file con 75 aggiunte e 7 eliminazioni
  1. 75 7
      core/CoreApp/controllers/Returngoods.php

+ 75 - 7
core/CoreApp/controllers/Returngoods.php

@@ -119,14 +119,29 @@ class Returngoods extends Start_Controller {
         print_r($data);
         die;
     }
-   
+
 
     public function _index(){
         $this->getUserShop();
         $this->data['status_list'] = $this->returngoods->getStatus();    
         $this->data['back_status_list'] = $this->returngoods->getBackStatus();    
-        $this->data['cate_one_list'] = $this->returngoods->getCateOne();    
-        $this->data['cate_two_list'] = json_encode($this->returngoods->getCateTwo());  
+        $this->data['cate_one_list'] = $this->returngoods->getCateOne();  
+        
+        $tmp_cate_two_list = $this->returngoods->getCateTwo();
+        $cate_two_list = [];
+        foreach ($tmp_cate_two_list as $k => $v) {
+            if(empty($v)){
+                $cate_two_list[$k] = [];
+            }else{
+                foreach($v as $k1 => $v1){
+                    $cate_two_list[$k][$v1] = $k1;
+                }
+            }
+            
+        }
+       
+        $this->data['cate_two_list'] = json_encode( $cate_two_list);  
+        
         $orderinfo = $this->input->get('orderinfo');
         $this->data['orderinfo'] = $orderinfo;
         $this->data['jjcd_list'] = $this->returngoods->getJinJiChengDu();
@@ -236,7 +251,20 @@ class Returngoods extends Start_Controller {
             $this->data['order_info'] = $order_info;
             $this->data['status_list'] = $this->returngoods->getStatus(); 
             $this->data['cate_one_list'] = $this->returngoods->getCateOne();    
-            $this->data['cate_two_list'] = json_encode($this->returngoods->getCateTwo());
+            $tmp_cate_two_list = $this->returngoods->getCateTwo();
+            $cate_two_list = [];
+            foreach ($tmp_cate_two_list as $k => $v) {
+                if(empty($v)){
+                    $cate_two_list[$k] = [];
+                }else{
+                    foreach($v as $k1 => $v1){
+                        $cate_two_list[$k][$v1] = $k1;
+                    }
+                }
+                
+            }
+       
+            $this->data['cate_two_list'] = json_encode($cate_two_list);  
             $this->data['jjcd'] = $this->returngoods->getJinJiChengDu();
             $this->data['shpjxx'] = $this->returngoods->getShouHouPingJiaXuanXian();
             $this->data['shop_info'] = $this->shop->read($order_info['shop']);
@@ -322,7 +350,19 @@ class Returngoods extends Start_Controller {
         $this->data['order_info'] = $order_info;
         $this->data['status_list'] = $this->returngoods->getStatus(); 
         $this->data['cate_one_list'] = $this->returngoods->getCateOne();    
-        $this->data['cate_two_list'] = json_encode($cate_list);
+        $tmp_cate_two_list = $this->returngoods->getCateTwo();
+        $cate_two_list = [];
+        foreach ($tmp_cate_two_list as $k => $v) {
+            if(empty($v)){
+                $cate_two_list[$k] = [];
+            }else{
+                foreach($v as $k1 => $v1){
+                    $cate_two_list[$k][$v1] = $k1;
+                }
+            }
+            
+        }
+        $this->data['cate_two_list'] = json_encode( $cate_two_list);  
         $this->data['cate_two_show'] =  $cate_list[$info['cate_one']];
         $this->data['shop_info'] = $this->shop->read($order_info['shop']);
         $this->data['jjcd'] = $this->returngoods->getJinJiChengDu();
@@ -1450,7 +1490,21 @@ class Returngoods extends Start_Controller {
         $this->data['status_list'] = $this->returngoods->getStatus();    
         $this->data['back_status_list'] = $this->returngoods->getBackStatus();    
         $this->data['cate_one_list'] = $this->returngoods->getCateOne();    
-        $this->data['cate_two_list'] = json_encode($this->returngoods->getCateTwo());    
+         
+        $tmp_cate_two_list = $this->returngoods->getCateTwo();
+        $cate_two_list = [];
+        foreach ($tmp_cate_two_list as $k => $v) {
+            if(empty($v)){
+                $cate_two_list[$k] = [];
+            }else{
+                foreach($v as $k1 => $v1){
+                    $cate_two_list[$k][$v1] = $k1;
+                }
+            }
+            
+        }
+       
+        $this->data['cate_two_list'] = json_encode( $cate_two_list);  
     
         $this->_Template("returngoods_check",$this->data);
     }
@@ -1460,7 +1514,21 @@ class Returngoods extends Start_Controller {
         $this->data['status_list'] = $this->returngoods->getStatus();    
         $this->data['back_status_list'] = $this->returngoods->getBackStatus();    
         $this->data['cate_one_list'] = $this->returngoods->getCateOne();    
-        $this->data['cate_two_list'] = json_encode($this->returngoods->getCateTwo());    
+         
+        $tmp_cate_two_list = $this->returngoods->getCateTwo();
+        $cate_two_list = [];
+        foreach ($tmp_cate_two_list as $k => $v) {
+            if(empty($v)){
+                $cate_two_list[$k] = [];
+            }else{
+                foreach($v as $k1 => $v1){
+                    $cate_two_list[$k][$v1] = $k1;
+                }
+            }
+            
+        }
+       
+        $this->data['cate_two_list'] = json_encode( $cate_two_list);    
     
         $this->_Template("returngoods_caiwu",$this->data);