一、数据缓存<?php $count = Yii::$app->cache->get('postCount');//从缓存读取数据 $dependency = new \yii\caching\DbDe pendency(['sql' => 'select count(id) from post']);//缓存依赖 if($count === false) { $count = \common\models\Post::find()->count(); Yii::$app->cache->set('p...
  •   文章分类
回到顶部