dever 6 years ago
parent
commit
1e8a5d1760
2 changed files with 16 additions and 1 deletions
  1. 10 0
      main/src/Journal.php
  2. 6 1
      main/src/Preview.php

+ 10 - 0
main/src/Journal.php

@@ -838,6 +838,12 @@ class Journal extends Core
             Dever::alert('小刊已下架');
         }
 
+        $status = false;
+        if (strstr($id, 'preview_')) {
+            $id = str_replace('preview_', '', $id);
+            $status = true;
+        }
+
         $where['id'] = $id;
         $this->data['info'] = Dever::db('journal/info')->one($where);
 
@@ -845,6 +851,10 @@ class Journal extends Core
             Dever::alert('小刊已下架');
         }
 
+        if ($status) {
+            $this->data['info']['status'] = '2';
+        }
+
         return $id;
     }
 

+ 6 - 1
main/src/Preview.php

@@ -31,7 +31,12 @@ class Preview
 
         $path = Dever::config('base')->applet_index;
         //$scene = Dever::login(-1) . ',' . $type . ',' . $id;
-        $scene = -1 . ',' . $type . ',' . $id;
+        if ($type == 4 || $type == 13) {
+            $scene = -1 . ',' . $type . ',' . 'preview_' . $id;
+        } else {
+            $scene = -1 . ',' . $type . ',' . $id;
+        }
+        
 
         if ($type == 13) {
             $id = $info['info_id'];