import request from '@/utils/request';
import { tableList } from '@/utils/format';
import type { CommoditySaleSummaryParams } from './data';
// import type { ModuleItem } from './data';


// 获取商户单品销售数据
export async function getCommoditySaleSummary(params: CommoditySaleSummaryParams) {
    const data = await request('/Sales/GetCommoditySaleSummary', {
        method: 'GET',
        params
    })
    
    if (data.Result_Code !== 100) {
        return {
            data: [],
            current:  1,
            pageSize:20,
            total: 0,
            success: true,
        };
    }
    
    return tableList(data.Result_Data)
}
