panlumeng hace 3 años
padre
commit
9922e654c4
Se han modificado 3 ficheros con 12 adiciones y 5 borrados
  1. 6 2
      app/admin/controller/Cat.php
  2. 1 1
      app/admin/controller/Sale.php
  3. 5 2
      app/common.php

+ 6 - 2
app/admin/controller/Cat.php

@@ -34,8 +34,12 @@ public function list(){
 //            $item[]=$var;
         }
     }
-//    $data=[];
-//    $db=Db::name('')
+    //var_dump(Db::name('cat')->getLastSql());
+    $data = Db::name("cat")->where(['pid'>0])->select();
+    $vmp = [];
+    foreach ($data as $sts){
+        $vmp[]=stro($sts);
+    }
     return app_show(0,"获取成功",$item);
 }
 }

+ 1 - 1
app/admin/controller/Sale.php

@@ -522,7 +522,7 @@ public function out(){
     $sendtime = isset($this->post['sendtime']) && $this->post['sendtime'] !=="" ? $this->post['sendtime']:date("Y-m-d H:i:s");
 //    $check_num = isset($this->post['check_num']) && $this->post['check_num'] !=="" ? $this->post['check_num'] :"";
 //    $error_num = isset($this->post['error_num']) && $this->post['error_num'] !=="" ? $this->post['error_num'] :"";
-    $status = isset($this->post['status']) && $this->post['status'] !=="" ? $this->post['status'] :"0";
+    $status = isset($this->post['status']) && $this->post['status'] !=="" ? $this->post['status'] :"1";
     //$dn=Db::name('sale_info')->where(['wsm_code'=>$outCode])->find();
     Db::startTrans();
     try {

+ 5 - 2
app/common.php

@@ -294,14 +294,17 @@ function crea($data,$vio=0)
     }
     return $data;
 }
-function str(){
+function stro(){
     $data=[];
     $db=Db::name('cat')->where(['pid'=>$data['id']])->select()->toArray();
     if(empty($db)){
         $data['child']=[];
         return $data;
     }
-
+    foreach ($db as $item) {
+        $data['child'][]=$item;
+        return $data;
+    }
 }
 /**
  * @param $files