MemberFields.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\Mc;
  7. class MemberFields extends \We7Table {
  8. protected $tableName = 'mc_member_fields';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'available',
  12. 'displayorder',
  13. 'fieldid',
  14. 'title',
  15. 'uniacid',
  16. );
  17. protected $default = array(
  18. 'available' => '1',
  19. 'displayorder' => '0',
  20. 'fieldid' => '',
  21. 'title' => '',
  22. 'uniacid' => '',
  23. );
  24. public function getAllFields() {
  25. return $this->query->from('mc_member_fields', 'a')
  26. ->leftjoin('profile_fields', 'b')
  27. ->on('a.fieldid', 'b.id')
  28. ->orderby('displayorder DESC')
  29. ->getall('field');
  30. }
  31. public function selectFields($select) {
  32. return $this->query->select($select);
  33. }
  34. public function searchWithUniacid($uniacid) {
  35. return $this->query->where('uniacid', $uniacid);
  36. }
  37. public function searchWithAvailable($available) {
  38. return $this->query->where('available', $available);
  39. }
  40. }