request->get(); $status = $get['status'] ?? 0; $export = $get['export']??0; $where = []; $where['mainId'] = $this->mainId; if (!empty($status)) { $where['status'] = $status; } $tx = $get['tx'] ?? 0; if (!empty($tx)) { $where['tx'] = $tx; } // 事件类型 if (isset($get['capitalType']) && $get['capitalType'] !== '') { $where['capitalType'] = (int)$get['capitalType']; } // 收支类型筛选:1 收入,0 支出;未传参时不筛选 if (isset($get['io']) && $get['io'] !== '') { $where['io'] = (int)$get['io']; } $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : ''; $startTime = $get['startTime'] ?? ''; $endTime = $get['endTime'] ?? ''; if (!empty($searchTime)) { $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true); $start = date("Y-m-d 00:00:00", strtotime($period['startTime'])); $end = date("Y-m-d 23:59:59", strtotime($period['endTime'])); $where['addTime'] = ['between', [$start, $end]]; } $list = ShopYeChangeClass::getChangeList($where); 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('最长可导出一个月'); } ShopYeChangeClass::exportData($list, $this->mainId); } util::success($list); } }