request->isAjax && Yii::$app->request->isGet) { $data = Yii::$app->request->get(); $valid = Yii::$app->services->validate->validate($data, [ [['page', 'limit'], 'integer'], [['keyword'], 'safe'], [['date_start', 'date_end'], 'string'], ]); if ($valid === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $fService = new FundService(); $ret = $fService->page($this->mall_id, $data); if (is_array($ret)) { $params = []; if (!SettingService::isMasterMall($this->mall_id)) { $params['mall_id'] = $this->mall_id; } $ret['config'] = (new SettingService())->get(SettingService::getMasterMall()); $ret['statistics'] = $fService->statistics($params); } return is_string($ret) ? $this->error($ret) : $this->success('获取成功', $ret); } return $this->render('index',['is_master' => SettingService::isMasterMall($this->mall_id), 'export_list' => Json::encode([ 'mall_id' => '商城ID', 'mall_name' => '商城名称', 'order_no' => '异动单号', 'created_at' => '创建时间', 'amount' => '异动金额', 'type' => '异动类型', 'direction' => '支出/收入', 'remark' => '异动备注' ])]); } public function actionDownload() { $post = \Yii::$app->request->post(); if (empty($post['mall_id'])) { if (!SettingService::isMasterMall($this->mall_id)) $post['mall_id'] = $this->mall_id; } $post['func'] = 'f'; $filename = '企商通-资金明细-' . date('YmdHis') . '_' . rand(10000, 99999); $res = CsvExportHelper::exportDownLoadCenter($this->mall_id, $filename, DownloadEnum::TYPE_QI_SHANG_TONG_FUND, DownloadLogic::class, 'exportHandle', $post); if ($res === false) return $this->error('加入导出任务失败' . CsvExportHelper::getStaticError()); return $this->success('添加导出任务成功,任务完成后请在下载中心进行下载!'); } }