|
@@ -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;
|