<?php

namespace App\Modules\User\Services;

use Redis;
use App\Modules\User\Models\UserRandSign;
use App\Modules\User\Services\UserService;

class UserRandSignService
{
    protected $table = 'user_sign';
    protected $fillable = ['uid', 'price', 'day', 'sign_time'];

    static function sign($params)
    {
        $params = [
            'uid'=>$params['uid'],
            'fee'=>$params['fee'],
            'day'=>$params['day']
        ];
        UserRandSign::add($params);
        UserService::addBalance($params['uid'], $params['fee'], 0, $params['fee']);
    }


    static function hasSigned($params)
    {
        $params = [
            'uid'=>$params['uid'],
            'day'=>$params['day']
        ];
        return UserRandSign::hasSigned($params);
    }


}
