dever 4 years ago
parent
commit
f779b1a343

+ 1 - 1
app/collection/lib/Core.php

@@ -47,7 +47,7 @@ class Core
     # 获取用户信息
     protected function getUser($uid, $collection_id)
     {
-        return Dever::load('user/lib/info')->get($uid, $collection_id);
+        return Dever::load('user/lib/info')->get($uid, $collection_id, true);
     }
 
     # 检查内容

+ 3 - 2
app/community/lib/Core.php

@@ -44,11 +44,12 @@ class Core
         if ($info) {
             foreach ($info as $k => $v) {
                 $user = Dever::load('user/lib/info')->get($v['uid'], $collection_id, true);
-                $result['user']['user_' . $user['id']] = array
+                $result['user']['user_' . $v['uid']] = array
                 (
-                    'id' => $user['id'],
+                    'id' => $v['uid'],
                     'username' => $user['username'],
                     'author' => $user['author'],
+                    'username_text' => $user['username_text'],
                 );
             }
         }

+ 1 - 1
app/community/lib/Info.php

@@ -157,7 +157,7 @@ class Info
         # 获取热门的子信息
         $info['child'] = array();
         if ($info['type'] < 20) {
-            $child = $this->getData('getHot', $uid, $info['cate_id'], 20, $info['id'], true, 1, false, false, $collection_id);
+            $child = $this->getData('getHot', $uid, $info['cate_id'], 20, $info['id'], true, false, $times, $info['day'], $collection_id);
             if ($child && $child['info']) {
                 $info['child'] = $child['info'];
                 $info['child_total'] = $child['total'];

+ 4 - 4
app/community/lib/Moment.php

@@ -86,8 +86,7 @@ class Moment
         }
         $where['state'] = 1;
         $table = $this->table;
-        $info = Dever::db($table)->one($where);
-
+        $info = false;
         $where['content'] = $content;
 
         if ($pic) {
@@ -100,7 +99,8 @@ class Moment
             $where['to_uid'] = $to_uid;
         }
 
-        if ($info && !$to_id) {
+        if ($info && $type == 3 && !$to_id) {
+            $info = Dever::db($table)->one($where);
             Dever::alert('已发布过动态,仅能发布一次,可删除旧动态后再添加');
         }
         //$info = false;
@@ -179,7 +179,7 @@ class Moment
         # 获取热门的子信息
         $info['child'] = array();
         if ($info['type'] < 20) {
-            $child = $this->getData('getHot', $uid, $key, $info['id'], true, 1, false, false, $collection_id);
+            $child = $this->getData('getHot', $uid, $key, $info['id'], true, false, $times, $info['day'], $collection_id);
             if ($child && $child['info']) {
                 $info['child'] = $child['info'];
                 $info['child_total'] = $child['total'];

+ 5 - 0
app/user/lib/Info.php

@@ -92,12 +92,17 @@ class Info
         $result['address_contact'] = $user['address_contact'] ? $user['address_contact'] : $user['username'];
         $result['address_mobile'] = $user['address_mobile'] ? $user['address_mobile'] : $user['mobile'];
         $result['author'] = '';
+        $result['username_text'] = $result['username'];
         if ($author) {
             $collection = Dever::load('collection/lib/info')->get($id);
             if ($collection && $collection['uid'] > 0 && $collection['uid'] == $user['id']) {
                 $result['author'] = $collection['author_name'];
             }
         }
+
+        if ($result['author']) {
+            $result['username_text'] = '<span style="padding-right:4px;color: #00B3FF;">[' . $result['author'] . ']</span>' . $result['username'];
+        }
 		$this->user[$key] = $result;
 		
 		return $result;