BaseDao.php 410 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\admin\model\dao;
  3. use app\admin\traits\Curd;
  4. use think\facade\Db;
  5. class BaseDao
  6. {
  7. use Curd;
  8. protected $model;
  9. protected static $table;
  10. public static function getList()
  11. {
  12. return Db::table(self::$table)->select()->toArray();
  13. }
  14. public static function getById($id)
  15. {
  16. return Db::table(self::$table)->where(['id' => $id])->find();
  17. }
  18. }