dever 4 år sedan
förälder
incheckning
659a00f6d2
4 ändrade filer med 15 tillägg och 9 borttagningar
  1. 4 2
      app/collection/lib/Ranking.php
  2. 3 3
      app/community/lib/Core.php
  3. 4 4
      app/community/src/Api.php
  4. 4 0
      app/user/lib/Info.php

+ 4 - 2
app/collection/lib/Ranking.php

@@ -10,7 +10,9 @@ class Ranking
     # 积分回调,增加积分榜单
     public function score($log)
     {
-        $this->up($log['uid'], $log['type_id'], 4, $log['num']);
+        if ($log['type_id'] > 0) {
+            $this->up($log['uid'], $log['type_id'], 4, $log['num']);
+        }
     }
 
 	# 获取最新的总榜
@@ -72,7 +74,7 @@ class Ranking
         }
     }
 
-    # 加入到cron里 检测所有榜单是否有新的期数,如果没有,自动添加新的一期
+    # 加入到cron里 检测所有榜单是否有新的期数,如果没有,自动添加新的一期 collection/lib/ranking.cron
     public function cron_api()
     {
     	$ranking = Dever::db('collection/ranking')->getAll();

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

@@ -67,7 +67,7 @@ class Core
     }
 
     # 更新提交数据
-    public function submit($uid, $id, $type, $data = array())
+    public function submit($info_id, $uid, $id, $type, $data = array())
     {
         if ($this->otable) {
             $oinfo = Dever::load($this->otable)->get($uid, $id, $type);
@@ -100,9 +100,9 @@ class Core
         $state = Dever::db($table)->update(array('where_id' => $id, 'num_' . $this->name => $total));
 
         if ($up == 1) {
-            Dever::score($uid, 'submit_' . $this->name, $this->lang);
+            Dever::score($uid, 'submit_' . $this->name, $this->lang, false, false, false, 'collection/info', $info_id);
         } else {
-            Dever::score($uid, 'submit_no_' . $this->name, '取消' . $this->lang);
+            Dever::score($uid, 'submit_no_' . $this->name, '取消' . $this->lang, false, false, false, 'collection/info', $info_id);
         }
 
         return true;

+ 4 - 4
app/community/src/Api.php

@@ -211,7 +211,7 @@ class Api extends Core
     # 点赞
     public function up()
     {
-        $id = Dever::input('id');
+        $id = Dever::input('type_id');
         if (!$id) {
             Dever::alert('错误的信息');
         }
@@ -219,7 +219,7 @@ class Api extends Core
         if (!$type) {
             Dever::alert('错误的信息');
         }
-        Dever::load('community/lib/up')->submit($this->uid, $id, $type);
+        Dever::load('community/lib/up')->submit($this->id, $this->uid, $id, $type);
 
         return 'yes';
     }
@@ -227,7 +227,7 @@ class Api extends Core
     # 反对
     public function oppose()
     {
-        $id = Dever::input('id');
+        $id = Dever::input('type_id');
         if (!$id) {
             Dever::alert('错误的信息');
         }
@@ -235,7 +235,7 @@ class Api extends Core
         if (!$type) {
             Dever::alert('错误的信息');
         }
-        Dever::load('community/lib/oppose')->submit($this->uid, $id, $type);
+        Dever::load('community/lib/oppose')->submit($this->id, $this->uid, $id, $type);
 
         return 'yes';
     }

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

@@ -51,11 +51,15 @@ class Info
 	# 获取用户信息
 	public function get($user, $id, $author = false)
 	{
+
         if (is_array($user)) {
             $uid = $user['id'];
         } else {
             $uid = $user;
         }
+        if ($uid <= 0) {
+            return array();
+        }
         $key = 'user_' . $uid . '_' . $id . '_' . $author;
         if (isset($this->user[$key])) {
             return $this->user[$key];