pay_list_other.auto_cache.php 768 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. class pay_list_other_auto_cache extends auto_cache{
  3. private $key = "pay:list:other";
  4. public function load($param)
  5. {
  6. $list = $GLOBALS['cache']->get($this->key);
  7. if($list === false||1)
  8. {
  9. //unserialize(
  10. $sql = "select id,name,class_name,logo from ".DB_PREFIX."payment where is_effect = 1 and online_pay in (3,4) and class_name not like '%Aliapp%' order by sort";
  11. $list = $GLOBALS['db']->getAll($sql,true,true);
  12. foreach ( $list as $k => $v )
  13. {
  14. $list[$k]['logo'] = get_spec_image($v['logo']);
  15. }
  16. $GLOBALS['cache']->set($this->key,$list,3600,true);
  17. }
  18. return $list;
  19. }
  20. public function rm($param)
  21. {
  22. $GLOBALS['cache']->rm($this->key);
  23. }
  24. public function clear_all()
  25. {
  26. $GLOBALS['cache']->rm($this->key);
  27. }
  28. }
  29. ?>