ChapterReminderService.php 478 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Modules\Subscribe\Services;
  3. use App\Modules\Subscribe\Models\ChapterReminder;
  4. class ChapterReminderService
  5. {
  6. //判断是否提醒
  7. static function checkIsNoReminder($uid,$bid)
  8. {
  9. return ChapterReminder::where('uid',$uid)
  10. ->where('bid',$bid)
  11. ->count();
  12. }
  13. //创建提醒
  14. static function add($uid,$bid)
  15. {
  16. return ChapterReminder::firstOrCreate(compact('bid','uid'));
  17. }
  18. }