|
@@ -209,6 +209,7 @@ class ChapterController extends BaseController
|
|
|
Redis::hincrby('qapp:book:free:virtual:' . $free->id, $now, $fee);
|
|
|
Redis::sadd('qapp:free:virtual' . $now, $free->id);
|
|
|
Redis::sadd('qapp:free:virtual:uids'.$now.$free->id,$this->uid);
|
|
|
+ Redis::sadd('qapp:free:virtual:uids'.$free->id,$this->uid);
|
|
|
}
|
|
|
return response()->item(new ChapterTransformer, $this->getChapter($bid, $cid, $chapter));
|
|
|
}
|
|
@@ -281,10 +282,12 @@ class ChapterController extends BaseController
|
|
|
$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);
|
|
|
+ if(Redis::Sismember('qapp:free:virtual:uids'.$free_book->id,$this->uid)){
|
|
|
+ $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));
|