zhuchengjie 2 年之前
父节点
当前提交
36e7307489
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      app/Http/Controllers/QuickApp/User/ReadRecordController.php

+ 5 - 5
app/Http/Controllers/QuickApp/User/ReadRecordController.php

@@ -93,14 +93,14 @@ class ReadRecordController extends BaseController
                             $charge_type = $val->charge_type;
                             if($charge_type == 'BOOK'){
                                 //是否购买过该书,购买过则不删除
-                                $res = BookOrderService::getRecordByuidBid($this->uid,$val->bid);
+                                $result = BookOrderService::getRecordByuidBid($this->uid,$val->bid);
                             }elseif($charge_type == 'CHAPTER'){
                                 //是否购买过该书章节,购买过则不删除
-                                $res = ChapterOrderService::checkBookIsOrdered($this->uid,$val->bid);
+                                $result = ChapterOrderService::checkBookIsOrdered($this->uid,$val->bid);
                             }else{
-                                $res = false;
+                                $result = false;
                             }
-                            if ($res) {
+                            if ($result) {
                                 ReadRecordService::delReadRecordStatic($this->uid,[$val->bid]);
                             }
                         }
@@ -116,7 +116,7 @@ class ReadRecordController extends BaseController
                 }
             }
         }
-        if($res){
+        if(count($res) > 0){
             usort($res, function ($a, $b) {
                 if ($a['time'] >= $b['time']) return -1;
                 return 1;