group.table.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. class GroupTable extends We7Table {
  8. protected $tableName = 'users_group';
  9. protected $founderGroupTableName = 'users_founder_group';
  10. public function groupList($is_vice_founder = false) {
  11. $table_name = empty($is_vice_founder) ? $this->tableName : $this->founderGroupTableName;
  12. return $this->query->from($table_name)->getall();
  13. }
  14. public function searchGroup($is_vice_founder = false) {
  15. $table_name = empty($is_vice_founder) ? $this->tableName : $this->founderGroupTableName;
  16. return $this->query->from($table_name)->get();
  17. }
  18. public function searchWithId($id) {
  19. $this->query->where('id', $id);
  20. return $this;
  21. }
  22. public function searchWithName($name) {
  23. $this->query->where('name', $name);
  24. return $this;
  25. }
  26. public function searchWithNoId($id) {
  27. $this->query->where('id !=', $id);
  28. return $this;
  29. }
  30. }