<?php

namespace app\model;

/**
 * 打卡日志
 *
 * Class ClockLog
 * @package app\model
 */
class ClockLog extends Base
{
    public const TYPE_IN  = 'in';//上班
    public const TYPE_OUT = 'out';//下班

    public const STATUS_TODO = 0;//待审核
    public const STATUS_YES  = 1;//通过
    public const STATUS_NO   = -1;//不通过

    public function account()
    {
        return $this->hasOne(Account::class, 'id', 'account_id');
    }

    public static function typeText(): array
    {
        return [
            self::TYPE_IN  => '上班',
            self::TYPE_OUT => '下班',
        ];
    }

    public static function statusText(): array
    {
        return [
            self::STATUS_TODO => '待审核',
            self::STATUS_YES  => '审核通过',
            self::STATUS_NO   => '审核拒绝',
        ];
    }
}
