johnny1991
- johnny1991 2017-11-07 已签到连续签到2天,获得了10个金钱
- johnny1991 2017-11-06 已签到连续签到1天,获得了5个金钱
理论上来说是可以的,但非常不建议这么作
// 做法就是在frontend的config里面配置一个后台的module就可以访问,后台的module和controller了 'statistic' => [ 'class' => 'backend\modules\statistic\Module' ],
- johnny1991 2017-10-30 已签到连续签到1天,获得了5个金钱
- johnny1991 回复了 johnny1991 的回答
这个要看你的cache是怎么配置的,查看config,比如存在redis里面
// redis cache 'cache' => [ 'class' => 'yii\redis\Cache', 'redis' => 'redis' ], // db cache 'dbCache' => [ 'class' => 'yii\caching\DbCache', 'cacheTable'=>'dts_cache', ], // file cache 'fileCache' => [ 'class' => 'yii\caching\FileCache', ],
@Allener 请把你项目里面所有的配置文件全部找一遍,你看看cache这个组件,配置了几次,从你的情况看起来,你应该是其他地方配置了cache组件,而且用的不是fileCache
- johnny1991 回复了 johnny1991 的回答
$transaction = Yii::$app->getDb()->beginTransaction(); try { xxxx } catch (Exception $e) { $transaction->rollBack(); throw $e; } $transaction->commit(); return true;
- 你要确保在这个try外面没有transaction
- 失败是否有抛出异常并且被这里exception cache到
$transaction = Yii::$app->getDb()->beginTransaction(); try { xxxx } catch (Exception $e) { $transaction->rollBack(); throw $e; } $transaction->commit(); return true;
- johnny1991 2017-10-26 已签到连续签到3天,获得了15个金钱
- johnny1991 2017-10-25 已签到连续签到2天,获得了10个金钱