|
@@ -22,6 +22,7 @@ use App\Models\BuddhistPagesModel;
|
|
|
*/
|
|
*/
|
|
|
class BuddhistPagesService extends BaseService
|
|
class BuddhistPagesService extends BaseService
|
|
|
{
|
|
{
|
|
|
|
|
+ protected static $instance = null;
|
|
|
/**
|
|
/**
|
|
|
* 构造函数
|
|
* 构造函数
|
|
|
* @author wesmiler
|
|
* @author wesmiler
|
|
@@ -34,6 +35,18 @@ class BuddhistPagesService extends BaseService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 静态入口
|
|
|
|
|
+ * @return BuddhistPagesService|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function make(){
|
|
|
|
|
+ if(!self::$instance){
|
|
|
|
|
+ self::$instance = new BuddhistPagesService();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return self::$instance;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 获取列表
|
|
* 获取列表
|
|
|
* @return array
|
|
* @return array
|
|
|
* @since 2020/11/11
|
|
* @since 2020/11/11
|
|
@@ -59,4 +72,12 @@ class BuddhistPagesService extends BaseService
|
|
|
return parent::edit($data); // TODO: Change the autogenerated stub
|
|
return parent::edit($data); // TODO: Change the autogenerated stub
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取章节数量
|
|
|
|
|
+ * @param $id
|
|
|
|
|
+ * @return mixed
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getCount($id){
|
|
|
|
|
+ return $this->model::where(['bid'=> $id,'status'=> 1])->count('id');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|