chenbo 4 роки тому
батько
коміт
c86a4ef4d4
2 змінених файлів з 7 додано та 7 видалено
  1. 6 6
      lib/stock.class.php
  2. 1 1
      lib/table/table.class.php

+ 6 - 6
lib/stock.class.php

@@ -26,6 +26,12 @@ class Stock {
         return $Table_stock->getList($filter, $count, $page, $pagesize, $order);
     }
 
+    static public function getAllList()
+    {
+        $Table_stock = new Table_stock();
+        return $Table_stock->getList();
+    }
+
     static public function addOrUpdateByCode($attrs)
     {
         if (empty($attrs)) throw new Exception('参数不能为空', 101);
@@ -35,12 +41,6 @@ class Stock {
         return $id;
     }
 
-    static public function getAllList()
-    {
-        $Table_stock = new Table_stock();
-        return $Table_stock->getList(array(), 0, 0, 0, 1);  //升序
-    }
-
 }
 
 ?>

+ 1 - 1
lib/table/table.class.php

@@ -127,7 +127,7 @@ abstract class Table {
     //@param $pagesize -- 每页数量
     public function getList($filter = array(), $count = 0, $page = 0, $pagesize = 0, $order = 0){
         $where = $this->filterToWhere($filter);
-        $orderByStr = (empty($order) ? 'desc' : 'asc');
+        $orderByStr = (empty($order) ? 'asc' : 'desc');
 
         if($count == 0){//列表
             $sql = "select * from ". $this->table_fullname ." $where order by ".$this->table_id." ".$orderByStr;