<?php
namespace App\Modules\UserTask\Services;

use App\Modules\Subscribe\Models\Order;

/**
 * 充值任务
 */
class ChargeTask extends RepeatTask
{
    public function judgeUpTo()
    {
        switch ($this->task->code) {
            case 'date_charge_reward':
                return Order::where('uid', $this->uid)
                    ->where('status', 'PAID')
                    ->where('created_at', '>=', date('Y-m-d'))
                    ->exists();
            default:
                return false;
        }
    }
}