ChapterReminder.php 550 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Modules\Subscribe\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class ChapterReminder extends Model
  5. {
  6. protected $table = 'chapter_reminders';
  7. protected $fillable = [
  8. 'uid','bid'
  9. ];
  10. //判断是否提醒
  11. static function checkIsNoReminder($uid,$bid)
  12. {
  13. return self::where('uid',$uid)
  14. ->where('bid',$bid)
  15. ->count();
  16. }
  17. //创建提醒
  18. static function add($uid,$bid)
  19. {
  20. return self::firstOrCreate(compact('bid','uid'));
  21. }
  22. }