Members.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 Members extends \We7Table {
  8. protected $tableName = 'mc_members';
  9. protected $primaryKey = 'uid';
  10. protected $field = array(
  11. 'address',
  12. 'affectivestatus',
  13. 'alipay',
  14. 'avatar',
  15. 'bio',
  16. 'birthday',
  17. 'birthmonth',
  18. 'birthyear',
  19. 'bloodtype',
  20. 'company',
  21. 'constellation',
  22. 'createtime',
  23. 'credit1',
  24. 'credit2',
  25. 'credit3',
  26. 'credit4',
  27. 'credit5',
  28. 'credit6',
  29. 'education',
  30. 'email',
  31. 'gender',
  32. 'grade',
  33. 'graduateschool',
  34. 'groupid',
  35. 'height',
  36. 'idcard',
  37. 'interest',
  38. 'lookingfor',
  39. 'mobile',
  40. 'msn',
  41. 'nationality',
  42. 'nickname',
  43. 'occupation',
  44. 'password',
  45. 'pay_password',
  46. 'position',
  47. 'qq',
  48. 'realname',
  49. 'residecity',
  50. 'residedist',
  51. 'resideprovince',
  52. 'revenue',
  53. 'salt',
  54. 'site',
  55. 'studentid',
  56. 'taobao',
  57. 'telephone',
  58. 'uniacid',
  59. 'user_from',
  60. 'vip',
  61. 'weight',
  62. 'zipcode',
  63. 'zodiac',
  64. );
  65. protected $default = array(
  66. 'address' => '',
  67. 'affectivestatus' => '',
  68. 'alipay' => '',
  69. 'avatar' => '',
  70. 'bio' => '',
  71. 'birthday' => '0',
  72. 'birthmonth' => '0',
  73. 'birthyear' => '0',
  74. 'bloodtype' => '',
  75. 'company' => '',
  76. 'constellation' => '',
  77. 'createtime' => '',
  78. 'credit1' => '0.00',
  79. 'credit2' => '0.00',
  80. 'credit3' => '',
  81. 'credit4' => '0.00',
  82. 'credit5' => '0.00',
  83. 'credit6' => '0.00',
  84. 'education' => '',
  85. 'email' => '',
  86. 'gender' => '0',
  87. 'grade' => '',
  88. 'graduateschool' => '',
  89. 'groupid' => '0',
  90. 'height' => '',
  91. 'idcard' => '',
  92. 'interest' => '',
  93. 'lookingfor' => '',
  94. 'mobile' => '',
  95. 'msn' => '',
  96. 'nationality' => '',
  97. 'nickname' => '',
  98. 'occupation' => '',
  99. 'password' => '',
  100. 'pay_password' => '',
  101. 'position' => '',
  102. 'qq' => '',
  103. 'realname' => '',
  104. 'residecity' => '',
  105. 'residedist' => '',
  106. 'resideprovince' => '',
  107. 'revenue' => '',
  108. 'salt' => '',
  109. 'site' => '',
  110. 'studentid' => '',
  111. 'taobao' => '',
  112. 'telephone' => '',
  113. 'uniacid' => '',
  114. 'user_from' => '',
  115. 'vip' => '0',
  116. 'weight' => '',
  117. 'zipcode' => '',
  118. 'zodiac' => '',
  119. );
  120. public function searchWithUniacid($uniacid) {
  121. return $this->query->where('uniacid', $uniacid);
  122. }
  123. public function searchWithEmail($email) {
  124. return $this->query->where('email', $email);
  125. }
  126. public function searchWithMobile($mobile) {
  127. return $this->query->where('mobile', $mobile);
  128. }
  129. public function searchWithoutUid($uid) {
  130. return $this->query->where('uid <>', $uid);
  131. }
  132. public function searchCreditsRecordUid($uid) {
  133. $this->query->where('r.uid', $uid);
  134. return $this;
  135. }
  136. public function searchCreditsRecordType($type) {
  137. $this->query->where('r.credittype', $type);
  138. return $this;
  139. }
  140. public function searchWithMobileOrEmail($mobile_or_email) {
  141. $this->query->where('mobile', $mobile_or_email)->whereor('email', $mobile_or_email);
  142. return $this;
  143. }
  144. }