MemberCenterPluginBaseService.php 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/4/1
  6. * Time: 下午4:37
  7. */
  8. namespace app\frontend\modules\member\services;
  9. use app\common\helpers\Cache;
  10. abstract class MemberCenterPluginBaseService
  11. {
  12. public $request;
  13. public function init($request)
  14. {
  15. $this->request = $request;
  16. }
  17. abstract function getEnabled();
  18. abstract function getData();
  19. public function setRedis($key,$value,$expire = 5)
  20. {
  21. Cache::put($key,$value ,$expire);
  22. }
  23. public function getRedis($key)
  24. {
  25. if (!Cache::has($key)) {
  26. return null;
  27. }
  28. return Cache::get($key);
  29. }
  30. public function getShowVipPrice()
  31. {
  32. $set = \Setting::get('plugin.member-price.is_open_micro');
  33. if (!app('plugins')->isEnabled('member-price') || $set != 1) {
  34. return true;
  35. }
  36. return false;
  37. }
  38. }