bztang-admin/plugins/video-share/src/common/member/MemberCenterVideoShare.php

41 lines
1.0 KiB
PHP

<?php
namespace Yunshop\VideoShare\common\member;
use app\frontend\modules\member\services\MemberCenterPluginBaseService;
use Yunshop\VideoShare\common\model\VideoShareGoods;
/**
* Class MemberCenterVideoShare
* @package Yunshop\VideoShare\common\member
*/
class MemberCenterVideoShare extends MemberCenterPluginBaseService
{
public function getEnabled()
{
$set = \Setting::get('plugin.video-share');
if (empty($set) || empty($set['is_open'])) {
return false;
}
$count = $this->getRedis('member_center_video_share_'.\Yunshop::app()->uniacid);
if (is_null($count)) {
$count = VideoShareGoods::uniacid()
->where('status', 1)
->count();
$this->setRedis('member_center_video_share_'.\Yunshop::app()->uniacid,($count?:0));
}
if ($count > 0) {
return true;
}
return false;
}
public function getData()
{
return [];//本来这里返回数据的,但改为用原来的列表接口
}
}