<?php




namespace app\common\model\user;


use app\common\model\BaseModel;

class UserSign extends BaseModel
{

    public static function tablePk(): ?string
    {
        return 'sing_id';
    }

    public static function tableName(): string
    {
        return 'user_sign';
    }

    public function user()
    {
        return $this->hasOne(User::class, 'uid', 'uid');
    }

    public function searchUidAttr($query,$value)
    {
        $query->where('uid',$value);
    }

    public function searchDayAttr($query,$value)
    {
        $query->whereDay('create_time',$value);
    }
}
