dever 6 years ago
parent
commit
835436a54f
1 changed files with 18 additions and 0 deletions
  1. 18 0
      main/src/Journal.php

+ 18 - 0
main/src/Journal.php

@@ -527,6 +527,24 @@ class Journal extends Core
 
         $this->data['score'] = Dever::load('act/lib/score')->getList($id);
 
+        $this->data['my'] = array();
+        if ($this->data['uid'] && $this->data['score']) {
+            foreach ($this->data['score'] as $k => $v) {
+                if ($v['uid'] == $this->data['uid']) {
+                    $this->data['my'] = $v;
+                    $this->data['my']['pai'] = $k + 1;
+                }
+            }
+        }
+
+        if (!$this->data['my']) {
+            $my = Dever::load('act/lib/score')->getList($id, 4, $this->data['uid']);
+            if ($my) {
+                $this->data['my'] = $my[0];
+                $this->data['my']['pai'] = '50+';
+            }
+        }
+
         # 获取活动说明
         $this->data['active'] = Dever::db('journal/active')->one(array('id' => $id));