Bind.php 896 B

1234567891011121314151617181920212223242526272829303132333435
  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 Bind extends \We7Table {
  8. protected $tableName = 'users_bind';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uid',
  12. 'bind_sign',
  13. 'third_type',
  14. 'third_nickname',
  15. );
  16. protected $default = array(
  17. 'uid' => '',
  18. 'bind_sign' => '',
  19. 'third_type' => '0',
  20. 'third_nickname' => '',
  21. );
  22. public function getByTypeAndUid($type, $uid) {
  23. return $this->query->where('third_type', $type)->where('uid', $uid)->get();
  24. }
  25. public function getByTypeAndBindsign($type, $bind_sign) {
  26. return $this->query->where('third_type', $type)->where('bind_sign', $bind_sign)->get();
  27. }
  28. public function getAllByUid($uid) {
  29. return $this->query->where('uid', $uid)->getall('bind_sign');
  30. }
  31. }