dever 6 years ago
parent
commit
e17df44464
3 changed files with 6 additions and 2 deletions
  1. 1 0
      act/lib/Comment.php
  2. 3 0
      doc/apidoc.php
  3. 2 2
      main/lib/Core.php

+ 1 - 0
act/lib/Comment.php

@@ -25,6 +25,7 @@ class Comment
         if ($data) {
             foreach ($data as $k => $v) {
                 $user = Dever::load('passport/api')->info($v['uid']);
+                $data[$k]['time'] = Dever::mdate($v['cdate'], 2);
                 $data[$k]['username'] = $user['username'];
                 $data[$k]['avatar'] = $user['avatar'];
                 $data[$k]['cdate_time'] = date('Y-m-d H:i:s', $v['cdate']);

+ 3 - 0
doc/apidoc.php

@@ -389,6 +389,7 @@
  * @apiSuccess {String}   comment.avatar 头像
  * @apiSuccess {String}   comment.content 内容
  * @apiSuccess {String}   comment.num_up 点赞数
+ * @apiSuccess {String}   comment.time 时间,请用这个时间吧
  * @apiSuccess {String}   comment.cdate 时间
  * @apiSuccess {String}   comment.up 是否点赞 1为点赞 2为未点赞
 
@@ -435,6 +436,7 @@
  * @apiSuccess {String}   comment.avatar 头像
  * @apiSuccess {String}   comment.content 内容
  * @apiSuccess {String}   comment.num_up 点赞数
+ * @apiSuccess {String}   comment.time 时间,请用这个时间
  * @apiSuccess {String}   comment.cdate 时间
  * @apiSuccess {String}   comment.up 是否点赞 1为点赞 2为未点赞
 
@@ -542,6 +544,7 @@
  * @apiSuccess {String}   comment.avatar 头像
  * @apiSuccess {String}   comment.content 内容
  * @apiSuccess {String}   comment.num_up 点赞数
+ * @apiSuccess {String}   comment.time 时间,请用这个时间
  * @apiSuccess {String}   comment.cdate 时间
  * @apiSuccess {String}   comment.up 是否点赞 1为点赞 2为未点赞
 

+ 2 - 2
main/lib/Core.php

@@ -12,14 +12,14 @@ class Core
     {
         # 获取用户信息
         if ($this->checkUser) {
-            $this->data['uid'] = Dever::load('passport/applet')->check();
+            //$this->data['uid'] = Dever::load('passport/applet')->check();
         } else {
             $this->data['uid'] = Dever::load('passport/applet')->check(false);
         }
         if ($this->data['uid'] < 0) {
             $this->data['uid'] = 0;
         }
-        //$this->data['uid'] = 1;
+        $this->data['uid'] = 1;
 
         # 获取基本配置
         $this->data['config'] = Dever::db('main/config')->one();