1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Modules\Subscribe\Models;
- use Illuminate\Database\Eloquent\Model;
- class ChapterReminder extends Model
- {
- protected $table = 'chapter_reminders';
- protected $fillable = [
- 'uid','bid'
- ];
- //判断是否提醒
- static function checkIsNoReminder($uid,$bid)
- {
- return self::where('uid',$uid)
- ->where('bid',$bid)
- ->count();
- }
- //创建提醒
- static function add($uid,$bid)
- {
- return self::firstOrCreate(compact('bid','uid'));
- }
- }
|