pay_list_all.auto_cache.php 1.0 KB

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