diff --git a/app/Caches/MaxPointGiftId.php b/app/Caches/MaxPointGiftId.php deleted file mode 100644 index f68994e0..00000000 --- a/app/Caches/MaxPointGiftId.php +++ /dev/null @@ -1,34 +0,0 @@ -lifetime; - } - - public function getKey($id = null) - { - return 'max_point_gift_id'; - } - - public function getContent($id = null) - { - $gift = PointGiftModel::findFirst(['order' => 'id DESC']); - - return $gift->id ?? 0; - } - -} diff --git a/app/Caches/PointGift.php b/app/Caches/PointGift.php deleted file mode 100644 index 07f5afa0..00000000 --- a/app/Caches/PointGift.php +++ /dev/null @@ -1,36 +0,0 @@ -lifetime; - } - - public function getKey($id = null) - { - return "point_gift:{$id}"; - } - - public function getContent($id = null) - { - $giftRepo = new PointGiftRepo(); - - $gift = $giftRepo->findById($id); - - return $gift ?: null; - } - -} diff --git a/app/Http/Admin/Services/PointGift.php b/app/Http/Admin/Services/PointGift.php index 545092c8..d92502bb 100644 --- a/app/Http/Admin/Services/PointGift.php +++ b/app/Http/Admin/Services/PointGift.php @@ -7,7 +7,6 @@ namespace App\Http\Admin\Services; -use App\Caches\PointGift as PointGiftCache; use App\Library\Paginator\Query as PagerQuery; use App\Models\PointGift as PointGiftModel; use App\Repos\Course as CourseRepo; @@ -116,8 +115,6 @@ class PointGift extends Service break; } - $this->rebuildPointGiftCache($gift); - return $gift; } @@ -165,8 +162,6 @@ class PointGift extends Service $gift->update($data); - $this->rebuildPointGiftCache($gift); - return $gift; } @@ -178,8 +173,6 @@ class PointGift extends Service $gift->update(); - $this->rebuildPointGiftCache($gift); - return $gift; } @@ -191,8 +184,6 @@ class PointGift extends Service $gift->update(); - $this->rebuildPointGiftCache($gift); - return $gift; } @@ -203,13 +194,6 @@ class PointGift extends Service return $validator->checkPointGift($id); } - protected function rebuildPointGiftCache(PointGiftModel $gift) - { - $cache = new PointGiftCache(); - - $cache->rebuild($gift->id); - } - protected function createCoursePointGift($post) { $validator = new PointGiftValidator(); diff --git a/app/Http/Home/Controllers/PointGiftController.php b/app/Http/Home/Controllers/PointGiftController.php index 1b7a8c0d..5b2c4b16 100644 --- a/app/Http/Home/Controllers/PointGiftController.php +++ b/app/Http/Home/Controllers/PointGiftController.php @@ -87,7 +87,7 @@ class PointGiftController extends Controller $hotGifts = $this->getHotGifts(); $userBalance = $this->getUserBalance(); - $this->seo->prependTitle(['积分兑换', $gift['name']]); + $this->seo->prependTitle(['积分商城', $gift['name']]); $this->view->pick('point/gift/show'); $this->view->setVar('gift', $gift); diff --git a/app/Http/Home/Views/point/gift/list.volt b/app/Http/Home/Views/point/gift/list.volt index 6db04fc4..e6ca49e4 100644 --- a/app/Http/Home/Views/point/gift/list.volt +++ b/app/Http/Home/Views/point/gift/list.volt @@ -6,7 +6,7 @@
@@ -17,4 +17,4 @@ {{ js_include('home/js/point.gift.list.js') }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/Http/Home/Views/point/gift/show.volt b/app/Http/Home/Views/point/gift/show.volt index ae94d2e9..48d84652 100644 --- a/app/Http/Home/Views/point/gift/show.volt +++ b/app/Http/Home/Views/point/gift/show.volt @@ -10,7 +10,7 @@ @@ -55,7 +55,23 @@+ {{ gift.name }} + 查看 +
+ {% elseif gift.type == 3 %} + {% set vip_url = url({'for':'home.vip.index'}) %} ++ {{ gift.name }} + 查看 +
+ {% else %} + {{ gift.details }} + {% endif %} +