<?php

/**
 * 同布赌注表
 * User: ben
 */
class Sync_LoginLog extends Sync_Base {
    protected $dbKey = 'dw_chat';
    protected $frequency = 1;
    protected $index = 3;

    protected $dataField = ['account', 'trx_id', 'memo', 'update_time_int'];

    /**
     * 清除数据的时间间隔
     * @var int
     */
    protected $clearTtl = 600;
    protected $clearAction = 'clearlogin';

    public function __construct() {
        parent::__construct('login_log', 'id', 'update_time_int', 'loginlog');
    }

    protected function addNewRows($newRows) {
        foreach ($newRows as $k => $row) {
            $row['create_time'] = $this->formatDateTime($row['create_time']);

            $newRows[$k] = $row;
        }
        parent::addNewRows($newRows);
    }

    protected function updateRow($row, $priValue, $dbRow) {
        $row['create_time'] = $this->formatDateTime($row['create_time']);
        parent::updateRow($row, $priValue, $dbRow);
    }


}
