o1; $odds['d3w'] = (float) $value->o2; $odds['a3w'] = (float) $value->o3; } $odds['margin'] = (float) Margin::calculate([$odds['h3w'], $odds['d3w'], $odds['a3w']], 1); $odds['updated_at'] = now(); DB::table('odds_3ways_ht')->upsert( $odds, ['event_id', 'bookmaker_id'], ['h3w', 'd3w', 'a3w', 'margin', 'flags', 'updated_at'] ); } }