dever 6 years ago
parent
commit
f0f26c3613
2 changed files with 19 additions and 6 deletions
  1. 2 0
      config/env/localhost/default.php
  2. 17 6
      main/src/Journal.php

+ 2 - 0
config/env/localhost/default.php

@@ -74,12 +74,14 @@ $config['cache'] = array
     # 缓存保存方式,支持多个数据源、多台缓存服务器
     # 缓存保存方式,支持多个数据源、多台缓存服务器
     'store' => array
     'store' => array
     (
     (
+        /*
         array
         array
         (
         (
             'host' => 'jstyle-cache',
             'host' => 'jstyle-cache',
             'port' => '6379',
             'port' => '6379',
             'weight' => 100,
             'weight' => 100,
         ),
         ),
+        */
     ),
     ),
 );
 );
 
 

+ 17 - 6
main/src/Journal.php

@@ -60,6 +60,8 @@ class Journal extends Core
 
 
         $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
         $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
 
 
+        $this->data['push'] = $this->ding($this->data['push']);
+
         # 小刊列表
         # 小刊列表
         $where = array();
         $where = array();
         $where['cate_id'] = $cate['id'];
         $where['cate_id'] = $cate['id'];
@@ -87,6 +89,8 @@ class Journal extends Core
 
 
         $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
         $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
 
 
+        $this->data['push'] = $this->ding($this->data['push']);
+
         # 获取我的信息
         # 获取我的信息
         $this->data['user'] = Dever::load('passport/api')->info($this->data['uid']);
         $this->data['user'] = Dever::load('passport/api')->info($this->data['uid']);
         
         
@@ -109,13 +113,8 @@ class Journal extends Core
         return $this->data;
         return $this->data;
     }
     }
 
 
-    # 获取详细信息
-    private function info($data, $subscribe = true)
+    public function ding($data)
     {
     {
-        if ($data['pdate'] > 0) {
-            $data['pdate_time'] = date('Y-m-d H:i:s', $data['pdate']);
-        }
-
         if (isset($data['num_add_ding']) && isset($data['num_ratio_ding'])) {
         if (isset($data['num_add_ding']) && isset($data['num_ratio_ding'])) {
             $stat = Dever::db('stat/journal')->getNumByJournal(array('journal_id' => $data['id']));
             $stat = Dever::db('stat/journal')->getNumByJournal(array('journal_id' => $data['id']));
             if ($stat) {
             if ($stat) {
@@ -124,6 +123,18 @@ class Journal extends Core
             }
             }
         }
         }
 
 
+        return $data;
+    }
+
+    # 获取详细信息
+    private function info($data, $subscribe = true)
+    {
+        if ($data['pdate'] > 0) {
+            $data['pdate_time'] = date('Y-m-d H:i:s', $data['pdate']);
+        }
+
+        $data = $this->ding($data);
+
         if ($data['pic_view_bg']) {
         if ($data['pic_view_bg']) {
             $data['pic_view_bg'] = explode(',', $data['pic_view_bg']);
             $data['pic_view_bg'] = explode(',', $data['pic_view_bg']);
         } else {
         } else {