人人商城

AccountModules.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 AccountModules extends \We7Table {
  8. protected $tableName = 'uni_account_modules';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'module',
  13. 'enabled',
  14. 'shortcut',
  15. 'displayorder',
  16. 'settings',
  17. 'display',
  18. );
  19. protected $default = array(
  20. 'uniacid' => '',
  21. 'module' => '',
  22. 'enabled' => 0,
  23. 'shortcut' => 0,
  24. 'displayorder' => 0,
  25. 'settings' => '',
  26. 'display' => '',
  27. );
  28. public function isSettingExists($module_name) {
  29. global $_W;
  30. return $this->query->where('module', $module_name)->where('uniacid', $_W['uniacid'])->exists();
  31. }
  32. public function getByUniacidAndModule($module_name, $uniacid) {
  33. $result = $this->query->where('module', $module_name)->where('uniacid', $uniacid)->get();
  34. if (!empty($result)) {
  35. $result['settings'] = iunserializer($result['settings']);
  36. }
  37. return (array)$result;
  38. }
  39. }