rabin 2 years ago
parent
commit
e550f2813b
2 changed files with 5 additions and 4 deletions
  1. 2 2
      app/collection/lib/Create.php
  2. 3 2
      app/collection/lib/Spider.php

+ 2 - 2
app/collection/lib/Create.php

@@ -8,7 +8,7 @@ use Dever\Support\Img as Handle;
 class Create
 {
     # 自动创建
-    public function up($info_id, $source_id, $name, $desc, $year, $type = 11, $data, $cover = '')
+    public function up($info_id, $source_id, $name, $desc, $year, $type = 11, $data, $cover = '', $num = 9)
     {
         Dever::config('base')->hook = true;
         $where['info_id'] = $info_id;
@@ -32,7 +32,7 @@ class Create
         $result['cover_center'] = $cover;
 
         # 内容最大值
-        $content_max = 9;
+        $content_max = $num;
         # 章节最大值
         $parent_page_max = 12;
         # 子章节最大值

+ 3 - 2
app/collection/lib/Spider.php

@@ -47,8 +47,9 @@ class Spider
             Dever::alert('错误的配置');
         }
 
+        $num = 9;
         $where['use'] = 1;
-        $where['limit'] = '0,9';
+        $where['limit'] = '0,' . $num;
         $data = Dever::db('spider/data')->getAll($where);
 
         $name = $project['config'] ? $project['config'] : $project['name'];
@@ -73,7 +74,7 @@ class Spider
         foreach ($data as $k => $v) {
             $value = Dever::json_decode($v['value']);
             if (isset($value['name']) && isset($value['pic'])) {
-                $result = Dever::load('collection/lib/create.up', $info_id, $v['id'], $name, $value['name'], $year, $type, $value['pic']);
+                $result = Dever::load('collection/lib/create.up', $info_id, $v['id'], $name, $value['name'], $year, $type, $value['pic'], $num);
                 if ($result) {
                     $update['pic_cover'] = $result['cover_center'];
                     $update['pic_bg'][] = $result['cover'];