request->get(); $export = $get['export'] ?? 0; $where = []; $shopId = $this->shopId; $where['shopId'] = $shopId; $customId = $get['customId'] ?? 0; if (!empty($customId)) { $where['customId'] = $customId; } $searchTime = $get['searchTime'] ?? ''; if (!empty($searchTime)) { $startTime = $get['startTime'] ?? ''; $endTime = $get['endTime'] ?? ''; $period = dateUtil::formatTime($searchTime, $startTime, $endTime); $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]]; } else { if ($export == 1) { util::fail('请选择时间'); } } if ($export == 1) { ini_set('memory_limit', '2045M'); set_time_limit(0); if (isset($where['addTime']) == false) { util::fail('请选时间段'); } $start = $where['addTime'][1][0]; $end = $where['addTime'][1][1]; $monthTime = bcmul(31, 86400); $startArea = strtotime($start); $endArea = strtotime($end); $diff = bcsub($endArea, $startArea); if ($diff > $monthTime) { util::fail('最长可导出一个月'); } } $respond = CustomDebtChangeClass::getChangeList($where); if ($export == 1) { CustomDebtChangeClass::exportData($respond, $this->mainId); } util::success($respond); } }