CreateGroup.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. 'maxxzapp',
  17. 'maxaliapp',
  18. 'maxbaiduapp',
  19. 'maxtoutiaoapp',
  20. 'createtime',
  21. );
  22. protected $default = array(
  23. 'group_name' => '',
  24. 'maxaccount' => '0',
  25. 'maxwxapp' => '0',
  26. 'maxwebapp' => '0',
  27. 'maxphoneapp' => '0',
  28. 'maxxzapp' => '0',
  29. 'maxaliapp' => '0',
  30. 'maxbaiduapp' => '0',
  31. 'maxtoutiaoapp' => '0',
  32. 'createtime' => '',
  33. );
  34. public function searchWithGroupName($group_name) {
  35. $this->where('group_name', $group_name);
  36. return $this;
  37. }
  38. public function searchLikeGroupName($group_name) {
  39. $this->where("group_name LIKE", "%{$group_name}%");
  40. return $this;
  41. }
  42. public function searchWithId($id) {
  43. $this->where('id', $id);
  44. return $this;
  45. }
  46. public function searchWithoutId($id) {
  47. $this->where('id !=', $id);
  48. return $this;
  49. }
  50. public function getCreateGroupInfo() {
  51. return $this->get();
  52. }
  53. public function getCreateGroupInfoById($id) {
  54. return $this->where('id', $id)->get();
  55. }
  56. public function getCreateGroupList() {
  57. return $this->getall();
  58. }
  59. public function deleteById($id) {
  60. return $this->where('id', $id)->delete();
  61. }
  62. }