type='vacations' WHERE reason LIKE BINARY 'отпуск%';
DELETE FROM u4_portal.missed where type = 'vacations';
UPDATE u4_portal.missed SET type='absents';
Написал так:
public function updateMissed($console = false)
{
$table = 'missed';
$query = new Query;
$query->createCommand()->update('missed', ['type' => 'vacations'], ['like', 'reason', 'отпуск%'])->execute();
$query->createCommand()->delete('missed', ['type' => 'vacations'])->execute();
$query->createCommand()->update('missed', ['type' => 'absents'])->execute();
}
type и reason лучше бы кончено int сделать
Обсуждают сегодня