request->isAjax && $this->request->isGet) { $params = $this->request->getQueryParams(); $service = new OrderService(['mall_id' => $this->mall_id]); $list = $service->getOrderList($params); return $this->success('ok', $list); } if(Yii::$app->request->post('flag') == 'EXPORT'){ $post = Yii::$app->request->post(); $post['mall_id'] = $this->mall_id; $filename = '交易列表-' . date('YmdHis').'_'.rand(10000,99999); $post['sub_type'] = TaxOrder::SUB_TYPE_USER; $res = CsvExportHelper::exportDownLoadCenter($this->mall_id,$filename,DownloadEnum::TYPE_STATISTICS,TaxOrder::class,'exportHandle', $post); if ($res === false) return $this->error('加入导出任务失败'.CsvExportHelper::getStaticError()); return $this->success('添加导出任务成功,任务完成后请在下载中心进行下载!'); } return $this->render('index'); } /** * 添加交易 * * @return void */ public function actionAdd() { if ($this->request->isAjax) { $data = $this->request->post('data'); $service = new OrderService(['mall_id' => $this->mall_id]); return $service->addOrder($data) ? $this->success('ok') : $this->error($service->error); } return $this->render($this->action->id); } /** * 获取记帐本列表 * * @return void */ public function actionBookList() { if ($this->request->isAjax) { $service = new AccountService(['mall_id'=>$this->mall_id]); return $this->success('ok', $service->getBookList()); } } /** * 支付打款 * * @return void */ public function actionTrans() { if ($this->request->isAjax) { $service = new OrderService(['mall_id'=>$this->mall_id]); $id = $this->request->getQueryParam('id'); return $service->trans($id) ? $this->success('ok') : $this->error($service->error); } } /** * 批量汇款 * * @return void */ public function actionBatchTrans() { if ($this->request->isAjax) { $service = new OrderService(['mall_id'=>$this->mall_id]); $ids = $this->request->getBodyParam('ids'); return $service->batchTrans($ids) ? $this->success('添加成功') : $this->error($service->error); } } /** * 获取一个批次号 * * @return void */ public function actionBatchNum() { if ($this->request->isAjax) { return $this->success('ok', TaxOrder::getBatchNum()); } } /** * 手续费 * * @return void */ public function actionFee() { if ($this->request->isAjax) { $num = $this->request->get('num'); $service = new OrderService(['mall_id' => $this->mall_id]); return $this->success('ok', $service->getFeeDeatil($num)); } } }