// +---------------------------------------------------------------------- // +---------------------------------------------------------------------- // | 栏目模型 // +---------------------------------------------------------------------- namespace app\cms\model; use think\Model; /** * 模型 */ class Category extends Model { //刷新栏目索引缓存 public function category_cache() { $data = self::order("listorder DESC")->select(); $CategoryIds = array(); foreach ($data as $r) { $CategoryIds[$r['id']] = array( 'id' => $r['id'], 'catdir' => $r['catdir'], 'parentid' => $r['parentid'], ); } cache("Category", $CategoryIds); return $CategoryIds; } }