FounderOwnUsers.php 1006 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 FounderOwnUsers extends \We7Table {
  8. protected $tableName = 'users_founder_own_users';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uid',
  12. 'founder_uid',
  13. );
  14. protected $default = array(
  15. 'uid' => '',
  16. 'founder_uid' => '',
  17. );
  18. public function addOwnUser($uid, $founder_uid) {
  19. $fill = array(
  20. 'uid' => $uid,
  21. 'founder_uid' => $founder_uid,
  22. );
  23. return $this->fill($fill)->save();
  24. }
  25. public function updateOwnUser($uid, $founder_uid) {
  26. return $this->where('uid', $uid)->fill(array(
  27. 'uid' => $uid,
  28. 'founder_uid' => $founder_uid,
  29. ))->save();
  30. }
  31. public function getFounderByUid($uid) {
  32. return $this->where('uid', $uid)->get();
  33. }
  34. public function getFounderOwnUsersList($founder_uid) {
  35. return $this->where('founder_uid', $founder_uid)->getall('uid');
  36. }
  37. }