Cache.php 699 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class Cache extends Model
  5. {
  6. public function call($method)
  7. {
  8. $method = '_' . strtolower($method);
  9. if (method_exists($this, $method)) {
  10. return $this->$method();
  11. } else {
  12. return false;
  13. }
  14. }
  15. /**
  16. * 基本设置
  17. * @return array
  18. */
  19. private function _config()
  20. {
  21. $result = db('config')->select();
  22. if (is_array($result)) {
  23. $list_config = array();
  24. foreach ($result as $k => $v) {
  25. $list_config[$v['code']] = $v['value'];
  26. }
  27. }
  28. unset($result);
  29. return $list_config;
  30. }
  31. }