|
@@ -208,6 +208,7 @@ class ChapterController extends BaseController
|
|
$now = date('Y-m-d');
|
|
$now = date('Y-m-d');
|
|
Redis::hincrby('qapp:book:free:virtual:' . $free->id, $now, $fee);
|
|
Redis::hincrby('qapp:book:free:virtual:' . $free->id, $now, $fee);
|
|
Redis::sadd('qapp:free:virtual' . $now, $free->id);
|
|
Redis::sadd('qapp:free:virtual' . $now, $free->id);
|
|
|
|
+ Redis::sadd('qapp:free:virtual:uids'.$now.$free->id,$this->uid);
|
|
}
|
|
}
|
|
return response()->item(new ChapterTransformer, $this->getChapter($bid, $cid, $chapter));
|
|
return response()->item(new ChapterTransformer, $this->getChapter($bid, $cid, $chapter));
|
|
}
|
|
}
|
|
@@ -276,7 +277,16 @@ class ChapterController extends BaseController
|
|
'uid' => $this->uid, 'bid' => $bid, 'book_name' => $book_info->book_name,
|
|
'uid' => $this->uid, 'bid' => $bid, 'book_name' => $book_info->book_name,
|
|
'cid' => $cid, 'chapter_name' => $chapter->name, 'sequence' => $chapter->sequence
|
|
'cid' => $cid, 'chapter_name' => $chapter->name, 'sequence' => $chapter->sequence
|
|
]);
|
|
]);
|
|
-
|
|
|
|
|
|
+ //限免统计
|
|
|
|
+ $free_book = BookConfigService::getByBidNoFilter($bid);
|
|
|
|
+ if($free_book) {
|
|
|
|
+ if(strtotime($free_book->end_time)+7*86400 >= strtotime(date('Y-m-d'))) {
|
|
|
|
+ $now = date('Y-m-d');
|
|
|
|
+ Redis::hincrby('qapp:book:free:actuality:' . $free_book->id, $now, $fee);
|
|
|
|
+ Redis::sadd('qapp:free:actuality' . $now, $free_book->id);
|
|
|
|
+ Redis::sadd('qapp:free:actuality:uids'.$now.$free_book->id,$this->uid);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return response()->item(new ChapterTransformer, $this->getChapter($bid, $cid, $chapter));
|
|
return response()->item(new ChapterTransformer, $this->getChapter($bid, $cid, $chapter));
|
|
} else {
|
|
} else {
|
|
if ($book_info->charge_type == 'BOOK') {
|
|
if ($book_info->charge_type == 'BOOK') {
|