CreateGroup.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. namespace We7\Table\Users;
  7. class CreateGroup extends \We7Table {
  8. protected $tableName = 'users_create_group';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'group_name',
  12. 'maxaccount',
  13. 'maxwxapp',
  14. 'maxwebapp',
  15. 'maxphoneapp',
  16. 'maxaliapp',
  17. 'maxbaiduapp',
  18. 'maxtoutiaoapp',
  19. 'createtime',
  20. );
  21. protected $default = array(
  22. 'group_name' => '',
  23. 'maxaccount' => '0',
  24. 'maxwxapp' => '0',
  25. 'maxwebapp' => '0',
  26. 'maxphoneapp' => '0',
  27. 'maxaliapp' => '0',
  28. 'maxbaiduapp' => '0',
  29. 'maxtoutiaoapp' => '0',
  30. 'createtime' => '',
  31. );
  32. public function searchWithGroupName($group_name) {
  33. $this->where('group_name', $group_name);
  34. return $this;
  35. }
  36. public function searchLikeGroupName($group_name) {
  37. $this->where("group_name LIKE", "%{$group_name}%");
  38. return $this;
  39. }
  40. public function searchWithId($id) {
  41. $this->where('id', $id);
  42. return $this;
  43. }
  44. public function searchWithoutId($id) {
  45. $this->where('id !=', $id);
  46. return $this;
  47. }
  48. public function getCreateGroupInfo() {
  49. return $this->get();
  50. }
  51. public function getCreateGroupInfoById($id) {
  52. return $this->where('id', $id)->get();
  53. }
  54. public function getCreateGroupList() {
  55. return $this->getall();
  56. }
  57. public function deleteById($id) {
  58. return $this->where('id', $id)->delete();
  59. }
  60. }