user_carry_config.auto_cache.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. //提现手续费
  3. class user_carry_config_auto_cache extends auto_cache{
  4. public function load($param)
  5. {
  6. $key = $this->build_key(__CLASS__,$param);
  7. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  8. $config_list = $GLOBALS['cache']->get($key);
  9. if($config_list === false)
  10. {
  11. $config_list = array();
  12. if((int)$param['vip_id'] > 0 && $GLOBALS['db']->getOne("select count(*) from ".DB_PREFIX."user_carry_config where vip_id=".(int)$param['vip_id']."") > 0){
  13. $config_list = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user_carry_config where vip_id=".(int)$param['vip_id']." order by max_price ASC,id ASC");
  14. }
  15. else
  16. $config_list = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user_carry_config where vip_id=0 order by max_price ASC,id ASC");
  17. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  18. $GLOBALS['cache']->set($key,$config_list);
  19. }
  20. return $config_list;
  21. }
  22. public function rm($param)
  23. {
  24. $key = $this->build_key(__CLASS__,$param);
  25. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  26. $GLOBALS['cache']->rm($key);
  27. }
  28. public function clear_all()
  29. {
  30. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  31. $GLOBALS['cache']->clear();
  32. }
  33. }
  34. ?>