AuthGroupModel.php 812 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\common\model;
  3. class AuthGroupModel extends BaseModel
  4. {
  5. protected $table = 'erp_auth_group';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. public function findByPaginate(array $params) {
  11. $where = [
  12. ['is_delete', '=', 0]
  13. ];
  14. return $this->where($where)->order('create_time','desc')->paginate(['list_rows'=>10, "query" => $params]);
  15. }
  16. /**
  17. * @return AuthGroupModel[]|array|\think\Collection
  18. * @throws \think\db\exception\DataNotFoundException
  19. * @throws \think\db\exception\DbException
  20. * @throws \think\db\exception\ModelNotFoundException
  21. */
  22. public function fetchAllGroups() {
  23. return $this->where('is_delete',0)->select();
  24. }
  25. }