1. 程式人生 > >TP5快取的用法

TP5快取的用法

   $authRule = cache('authRule');
        if(!$authRule){
            $authRule = db('auth_rule')->where('level<2')->order('sort desc')->select();
            cache('authRule', $authRule, 3600);
       }