import { DataSource, Repository } from 'typeorm';
export async function handler(dataSource: DataSource, { user, query }) {
  console.log(query, '====================>');

  const [data] = await dataSource.query(`
  SELECT
  lt.duration as duration,
  (SELECT max(lm.total_user) from live_msg_data lm WHERE lm.room_id = ${query.id} )  count 
  FROM
  live_teaching lt

 WHERE
   lt.id = ${query.id}
        `);
  return data;
}
