Exemple #1
0
                $this->cache->set($cache_key, $cid, 2592000);
            }
        } elseif ($type == 2) {
            $sql = "SELECT id FROM " . DB_TABLEPRE . "category WHERE name='建议与意见'";
            $cache_key = md5($sql);
            $cache_data = $this->cache->get($cache_key);
            if (false !== $cache_data) {
                return $cache_data;
            }
            $cid = $this->db->result_first($sql);
            if (!empty($cid)) {
                $this->cache->set($cache_key, $cid, 2592000);
            }
        } elseif ($type == 3) {
            $sql = "SELECT id FROM " . DB_TABLEPRE . "category WHERE name='投诉'";
            $cache_key = md5($sql);
            $cache_data = $this->cache->get($cache_key);
            if (false !== $cache_data) {
                return $cache_data;
            }
            $cid = $this->db->result_first($sql);
            if (!empty($cid)) {
                $this->cache->set($cache_key, $cid, 2592000);
            }
        }
        return $cid;
    }
}
$crontab = new tag();
$crontab->tg2mem();