wupengfei 2 yıl önce
ebeveyn
işleme
af3694da42

+ 1 - 1
application/api/controller/Order.php

@@ -539,7 +539,7 @@ class Order extends Base
                 $array = [];
                 for ($i=0;$i<$order['num'];$i++){
                     //获取排名
-                    $rank = getRanking($order['c_id'])+1;
+                    $rank = getRanking($order['c_id']);
                     $tag = getTag($order['c_id'],$rank,$order['inventory']);
                     saveRanking($order['c_id']);
                     $company = '象寻数字科技(上海)有限公司';

+ 1 - 1
application/api/controller/Pay.php

@@ -127,7 +127,7 @@ class Pay extends Controller
             $pro_info = json_decode($order['pro_info'],true);
             for ($i=0;$i<$order['num'];$i++){
                 //获取排名
-                $rank = getRanking($order['c_id'])+1;
+                $rank = getRanking($order['c_id']);
                 $tag = getTag($order['c_id'],$rank,$order['inventory']);
                 saveRanking($order['c_id']);
                 $company = '象链数藏';

+ 1 - 1
application/api/controller/Pay2.php

@@ -87,7 +87,7 @@ class Pay2 extends Controller
             $pro_info = json_decode($order['pro_info'],true);
             for ($i=0;$i<$order['num'];$i++){
                 //获取排名
-                $rank = getRanking($order['c_id'])+1;
+                $rank = getRanking($order['c_id']);
                 $tag = getTag($order['c_id'],$rank,$order['inventory']);
                 saveRanking($order['c_id']);
                 $company = '象寻数字科技(上海)有限公司';

+ 1 - 1
application/api/controller/Synthetic.php

@@ -200,7 +200,7 @@ class Synthetic extends Base
 
 
             //获取排名
-            $rank = getRanking($id)+1;
+            $rank = getRanking($id);
             $tag = getTag($id,$rank,$info['inventory']);
             saveRanking($id);
             $company = '象链数藏';

+ 1 - 1
application/api/controller/Timedtask.php

@@ -283,7 +283,7 @@ class Timedtask
                 ->leftJoin('store_member u','u.id=o.mid')
                 ->where($where)->order('o.id desc')->select();
             foreach ($user_list as $user_coll) {
-                $rank = getRanking($v['send_goods'])+1;
+                $rank = getRanking($v['send_goods']);
                 $inventory = Db::name('store_collect')->where('id',$v['send_goods'])->value('inventory');
                 $tag = getTag($v['send_goods'],$rank,$inventory);
                 saveRanking($v['send_goods']);

+ 1 - 1
application/api/controller/UserCenter.php

@@ -1160,7 +1160,7 @@ class UserCenter extends Base
                     ];
                     Db::name('store_blind_box_log')->insert($data);
                     //获取排名
-                    $rank = getRanking($win_prize_id)+1;
+                    $rank = getRanking($win_prize_id);
                     $tag = getTag($win_prize_id,$rank,$coll_info['inventory']);
                     saveRanking($win_prize_id);
                     $company = '象链数藏';

+ 2 - 7
application/common.php

@@ -366,19 +366,14 @@ function addCollectionInventory($id,$num){
  * 用户购买藏品排名更新
  */
 function saveRanking($id){
-    $redis = new \think\cache\driver\Redis();
-    $redis->Incr('ranking'.$id);
+
 }
 /**
  * 获取用户购买藏品排名更新
  */
 function getRanking($id){
     $redis = new \think\cache\driver\Redis();
-    $count =  $redis->get('ranking'.$id);
-    if (empty($count)){
-        $redis->set('ranking'.$id,0);
-    }
-    $count = empty($count) ? 0 : $count;
+    $count =  $redis->Incr('ranking'.$id);
     return $count;
 }
 

+ 2 - 2
thinkphp/library/think/cache/driver/Redis.php

@@ -306,7 +306,7 @@ class Redis extends Driver
 	 */
     public function Incr($key){
 
-        $this->handler->incr($key);
+        return $this->handler->incr($key);
     }
 
     /*
@@ -315,7 +315,7 @@ class Redis extends Driver
     */
     public function Incrby($key,$number){
 
-        $this->handler->incrby($key,$number);
+       return $this->handler->incrby($key,$number);
     }
     /*
 	 *将 key 中储存的数字值减一。