FounderOwnUniGroups.php 999 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 FounderOwnUniGroups extends \We7Table {
  8. protected $tableName = 'users_founder_own_uni_groups';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'founder_uid',
  12. 'uni_group_id',
  13. );
  14. protected $default = array(
  15. 'founder_uid' => '',
  16. 'uni_group_id' => '',
  17. );
  18. public function addOwnUniGroup($founder_uid, $uni_group_id) {
  19. $fill = array(
  20. 'founder_uid' => $founder_uid,
  21. 'uni_group_id' => $uni_group_id,
  22. );
  23. return $this->fill($fill)->save();
  24. }
  25. public function getOwnUniGroupsByFounderUid($founder_uid) {
  26. return $this->where('founder_uid', $founder_uid)
  27. ->getall('uni_group_id');
  28. }
  29. public function getByFounderUidAndUniGroupId($founder_uid, $uni_group_id) {
  30. return $this->where('founder_uid', $founder_uid)->where('uni_group_id', $uni_group_id)->get();
  31. }
  32. }