OperateStar.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 OperateStar extends \We7Table {
  8. protected $tableName = 'users_operate_star';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'createtime',
  12. 'rank',
  13. 'module_name',
  14. 'type',
  15. 'uid',
  16. 'uniacid',
  17. );
  18. protected $default = array(
  19. 'createtime' => '',
  20. 'rank' => 0,
  21. 'module_name' => '',
  22. 'type' => '',
  23. 'uid' => '',
  24. 'uniacid' => '',
  25. );
  26. public function getMaxRank() {
  27. global $_W;
  28. $rank_info = $this->query->select('max(rank)')->where('uid', $_W['uid'])->getcolumn();
  29. return $rank_info;
  30. }
  31. public function getALlByUid($uid) {
  32. return $this->query->where('uid', $uid)->orderby('rank', 'DESC')->getall();
  33. }
  34. public function getByUidUniacidModulename($uid, $uniacid, $module_name) {
  35. return $this->query->where('uid', $uid)->where('uniacid', $uniacid)->where('module_name', $module_name)->get();
  36. }
  37. public function searchWithLimit($limit_num) {
  38. return $this->query->limit($limit_num);
  39. }
  40. }