|
|
@@ -9,6 +9,7 @@ class SqlTableModel
|
|
|
{
|
|
|
public static $table_name = '';
|
|
|
public static $primary_key = [];
|
|
|
+ protected static $default_item = [];
|
|
|
|
|
|
|
|
|
public static function getDb()
|
|
|
@@ -67,6 +68,17 @@ class SqlTableModel
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static function getAllPagination($where=null, $options=[])
|
|
|
+ {
|
|
|
+ $db = static::getDb();
|
|
|
+ static::checkTable();
|
|
|
+
|
|
|
+ $tuple = $db->getTable(static::$table_name)->getAllWithFoundRows($where, $options);
|
|
|
+ //list($found_rows, $data) = $tuple;
|
|
|
+ return $tuple;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public static function one($where=[], $options=[])
|
|
|
{
|
|
|
@@ -158,4 +170,11 @@ class SqlTableModel
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public static function getDefaultItem()
|
|
|
+ {
|
|
|
+ return array_slice(static::$default_item, 0);
|
|
|
+ }
|
|
|
+
|
|
|
}
|