$row) { $row['banker'] = implode('|', $row['banker']); $row['player'] = implode('|', $row['player']); $row['create_time'] = $this->formatDateTime($row['create_time']); $row['create_block_num'] = Eos::getRealBlockNum($row['create_trans_id']); $newRows[$k] = $row; } parent::addNewRows($newRows); foreach ($newRows as $row) { $eventData = [ 'old' => $this->objTable->getOne([ '_field' => 'id', '_where' => "id<{$row['id']}", '_sortKey' => 'id DESC', '_limit' => 1, ]), 'new' => $row['id'], ]; Eos::pubEvent('baccarat:new_game', $eventData); } } // protected function updateDb($rows) { // // parent::updateDb($rows); // } protected function updateRow($row, $priValue, $dbRow) { if ($row['game_state'] == Game::STATUS_PLAYING && in_array($dbRow['game_state'], [Game::STATUS_PLAYING, Game::STATUS_OPENING]) && $dbRow['create_block_num']) { return; } $row['banker'] = implode('|', $row['banker']); $row['player'] = implode('|', $row['player']); $row['create_time'] = $this->formatDateTime($row['create_time']); $row['create_block_num'] = Eos::getRealBlockNum($row['create_trans_id']); parent::updateRow($row, $priValue, $dbRow); } }