getChannelUserId(); if(!$channel_user_id) return response()->error('PARAM_ERROR'); $distribution_channel_ids = ChannelService::getUserChannelIds($channel_user_id); $stats = OrderStatService::getChannelTotalStat($distribution_channel_ids); $stats->cost_sum = SendOrderService::getCostStats($distribution_channel_ids); return response()->item(new OrderStatTransformer(), $stats); } public function getSendOrdersRechargeStats(Request $request) { $channel_user_id = $this->getChannelUserId(); if(!$channel_user_id) return response()->error('PARAM_ERROR'); $distribution_channel_ids = ChannelService::getUserChannelIdsV2($channel_user_id); $stats = SendOrderStatService::getSendOrdersRechargeDetail($distribution_channel_ids); return response()->pagination(new OrdersRechargeTransformer(),$stats); } public function exportSendOrdersRechargeStats(){ $channel_user_id = $this->getChannelUserId(); if(!$channel_user_id) return response()->error('PARAM_ERROR'); $distribution_channel_ids = ChannelService::getUserChannelIdsV2($channel_user_id); $stats = SendOrderStatService::exportSendOrdersRechargeDetail($distribution_channel_ids); saveExcelData($stats['header'],$stats['data'],''); } }