dever 6 years ago
parent
commit
465c809fcc
1 changed files with 19 additions and 0 deletions
  1. 19 0
      main/src/Journal.php

+ 19 - 0
main/src/Journal.php

@@ -247,6 +247,25 @@ class Journal extends Core
 
         $this->data['score'] = Dever::load('act/lib/score')->getList($id);
 
+        # 获取活动说明
+        $this->data['active'] = Dever::db('journal/active')->one(array('id' => $id));
+
+
+        if (!$this->data['active']) {
+            return $this->data;
+        }
+
+        $time = time();
+        if ($this->data['active'] && $time >= $this->data['active']['start'] && $time < $this->data['active']['end']) {
+            $this->data['active']['status'] = 1;
+        } else {
+            $this->data['active']['status'] = 2;
+        }
+
+        if ($time < $this->data['active']['start']) {
+            $this->data['active']['status'] = 3;
+        }
+
         return $this->data;
     }