|
|
@@ -24,6 +24,8 @@ use App\Services\RedisService;
|
|
|
*/
|
|
|
class AdService extends BaseService
|
|
|
{
|
|
|
+ protected static $instance = null;
|
|
|
+
|
|
|
/**
|
|
|
* 构造函数
|
|
|
* @author laravel开发员
|
|
|
@@ -36,6 +38,18 @@ class AdService extends BaseService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 静态入口
|
|
|
+ * @return static|null
|
|
|
+ */
|
|
|
+ public static function make()
|
|
|
+ {
|
|
|
+ if (!self::$instance) {
|
|
|
+ self::$instance = (new static());
|
|
|
+ }
|
|
|
+ return self::$instance;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 按广告位获取缓存列表
|
|
|
* @param $position
|
|
|
* @param int $num
|