import {tableList, wrapTreeNode} from '@/utils/format';
// import request from '@/utils/requestCode';
import requestNormal from '@/utils/request';

export async function handleGetRevenueReportByDate(params?: any) {
  const data = await requestNormal(`/Revenue/GetRevenueReportByDate`, {
    method: 'GET',
    params: { ...params }
  });

  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }

  return wrapTreeNode(data.Result_Data.List);
}

