diff --git a/app/Caches/Counter.php b/app/Caches/Counter.php index 7d985e02..14ece69f 100644 --- a/app/Caches/Counter.php +++ b/app/Caches/Counter.php @@ -9,6 +9,7 @@ namespace App\Caches; use App\Library\Cache\Backend\Redis as RedisCache; use Phalcon\Di\Injectable; +use Redis; abstract class Counter extends Injectable { @@ -19,7 +20,7 @@ abstract class Counter extends Injectable protected $cache; /** - * @var \Redis + * @var Redis */ protected $redis; @@ -30,19 +31,13 @@ abstract class Counter extends Injectable $this->redis = $this->cache->getRedis(); } - /** - * 获取缓存内容 - * - * @param mixed $id - * @return array - */ public function get($id = null) { $key = $this->getKey($id); $content = $this->redis->hGetAll($key); - if (!$this->cache->exists($key)) { + if (!$this->redis->exists($key)) { $content = $this->getContent($id); $lifetime = $this->getLifetime(); @@ -54,23 +49,13 @@ abstract class Counter extends Injectable return $content; } - /** - * 删除缓存内容 - * - * @param mixed $id - */ public function delete($id = null) { $key = $this->getKey($id); - $this->cache->delete($key); + $this->redis->del($key); } - /** - * 重建缓存内容 - * - * @param mixed $id - */ public function rebuild($id = null) { $this->delete($id); diff --git a/app/Caches/UserDailyCounter.php b/app/Caches/UserDailyCounter.php index 19f59830..9497d1c7 100644 --- a/app/Caches/UserDailyCounter.php +++ b/app/Caches/UserDailyCounter.php @@ -10,8 +10,6 @@ namespace App\Caches; class UserDailyCounter extends Counter { - protected $lifetime = 86400; - public function getLifetime() { $tomorrow = strtotime('tomorrow'); diff --git a/app/Http/Admin/Views/user/search.volt b/app/Http/Admin/Views/user/search.volt index 0d88f3c3..df41dc26 100644 --- a/app/Http/Admin/Views/user/search.volt +++ b/app/Http/Admin/Views/user/search.volt @@ -35,7 +35,7 @@
学习期限 - {{ course.study_expiry }}个月 + {{ course.study_expiry }} 个月 {% if course.refund_expiry > 0 %} 退款期限 - {{ course.refund_expiry }}天 + {{ course.refund_expiry }} 天 {% else %} 退款期限 不支持 @@ -82,7 +82,7 @@
期限 - {{ vip.expiry }}个月 + {{ vip.expiry }} 个月