ModulesCommonUse.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\Uni;
  7. class ModulesCommonUse extends \We7Table {
  8. protected $tableName = 'uni_modules_common_use';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'modulename',
  13. 'uid',
  14. 'displayorder',
  15. 'createtime',
  16. 'updatetime',
  17. );
  18. protected $default = array(
  19. 'uniacid' => '',
  20. 'modulename' => '',
  21. 'uid' => '',
  22. 'displayorder' => '0',
  23. 'createtime' => '',
  24. 'updatetime' => '',
  25. );
  26. public function searchByUid($uid) {
  27. return $this->query->where('uid', $uid);
  28. }
  29. public function searchByUniacid($uniacid) {
  30. return $this->query->where('uniacid', $uniacid);
  31. }
  32. public function searchByModuleName($modulename) {
  33. return $this->query->where('modulename', $modulename);
  34. }
  35. public function searchWithoutModuleName() {
  36. return $this->query->where('modulename', '');
  37. }
  38. public function getCommonUseModule($uid, $uniacid, $modulename) {
  39. return $this->where(array('uid' => $uid, 'uniacid' => $uniacid, 'modulename' => $modulename))->get();
  40. }
  41. public function getCommonUseModuleList($pageindex = 1, $pagesize = 15) {
  42. return $this->query->page($pageindex, $pagesize)->orderby('displayorder', 'desc')->getall();
  43. }
  44. }