|
@@ -3,6 +3,9 @@
|
|
|
namespace App\Http\Controllers\QuickApp\User;
|
|
|
|
|
|
use App\Consts\SysConsts;
|
|
|
+use App\Modules\Subscribe\Services\BookOrderService;
|
|
|
+use App\Modules\Subscribe\Services\ChapterOrderService;
|
|
|
+use App\Modules\Subscribe\Services\YearOrderService;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Http\Controllers\QuickApp\BaseController;
|
|
|
use App\Modules\Book\Services\BookConfigService;
|
|
@@ -65,6 +68,10 @@ class ReadRecordController extends BaseController
|
|
|
{
|
|
|
$user = $this->user_info;
|
|
|
$res = ReadRecordService::getReadRecord($this->uid);
|
|
|
+ //补充操作:如果该用户未订阅该下架的书籍则删除其阅读记录(书架不予显示)
|
|
|
+ //判断是否属于包年用户
|
|
|
+ $year_account = YearOrderService::getRecord($this->uid);
|
|
|
+
|
|
|
if ($res) {
|
|
|
$id_arr = [];
|
|
|
foreach ($res as $key => $value) {
|
|
@@ -81,6 +88,22 @@ class ReadRecordController extends BaseController
|
|
|
$value['author'] = '';
|
|
|
foreach ($book as $val) {
|
|
|
if ($value['bid'] == $val->bid) {
|
|
|
+ if(!$year_account && !in_array($val->is_on_shelf,[1,2]) ){
|
|
|
+ //获取书籍充值类型
|
|
|
+ $charge_type = $val->charge_type;
|
|
|
+ if($charge_type == 'BOOK'){
|
|
|
+ //是否购买过该书,购买过则不删除
|
|
|
+ $res = BookOrderService::getRecordByuidBid($this->uid,$val->bid);
|
|
|
+ }elseif($charge_type == 'CHAPTER'){
|
|
|
+ //是否购买过该书章节,购买过则不删除
|
|
|
+ $res = ChapterOrderService::checkBookIsOrdered($this->uid,$val->bid);
|
|
|
+ }else{
|
|
|
+ $res = false;
|
|
|
+ }
|
|
|
+ if ($res) {
|
|
|
+ ReadRecordService::delReadRecordStatic($this->uid,[$val->bid]);
|
|
|
+ }
|
|
|
+ }
|
|
|
$value['book_name'] = $val->book_name;
|
|
|
$value['cover'] = $val->cover;
|
|
|
$value['last_chapter'] = $val->last_chapter;
|