service = new AccountService(['mall_id' => $this->mall_id]); } /** * 首页 * * @return string */ public function actionIndex() { if ($this->request->isAjax) { $list = $this->service->getAccountList( $this->request->getBodyParams() ); return $this->success('ok', $list); } return $this->render('index'); } /** * 是否新签约 * * @return mixed */ public function actionIsSign() { $type = $this->request->get('type'); $is_new_sign = $this->service->getIsNewSign($type); return $this->success('ok', compact('is_new_sign')); } /** * 跳转签约 (税务方签约) * * @return void */ public function actionSign() { $type = $this->request->get('type'); $html = $this->service->sign($type); echo $html; } /** * 添加签约 不跳转 * * @return mixed */ public function actionAddSign() { $type = $this->request->get('type'); $model = $this->service->sign($type); if ($model) $this->service->query($model->id); return $this->success(); } /** * 签约查询 * * @return void */ public function actionQuery() { if ($this->request->isAjax) { $id = $this->request->getQueryParam('id'); return $this->service->query($id) ? $this->success('查询成功') : $this->error($this->service->error); } } /** * 记帐本查询 * * @return void */ public function actionQueryBook() { if ($this->request->isAjax) { $id = $this->request->getQueryParam('id'); return ($data = $this->service->queryBook($id)) ? $this->success('ok', $data) : $this->error($this->service->error); } } /** * 设为默认值 * * @return void */ public function actionSetDefault() { if ($this->request->isAjax) { $id = $this->request->getQueryParam('id'); $type = $this->request->get('type'); return $this->service->setDefault($id, $type) ? $this->success('ok') : $this->error($this->service->error); } } /** * 记账本充值 * * @return void */ public function actionRecharge() { $id = $this->request->get('id'); $amount = $this->request->get('amount'); $html = $this->service->recharge($id, $amount); echo $html; } /** * 记账本资金逆流 * * @return void */ public function actionAnarrhea() { if ($this->request->isAjax) { $id = $this->request->get('id'); return $this->service->anarrhea($id) ? $this->success('ok') : $this->error($this->service->getError()); } } /** * 删除记账本 * * @return void */ public function actionDel() { if ($this->request->isAjax) { $id = $this->request->get('id'); return $this->service->deleteNotSign($id) ? $this->success('ok') : $this->error($this->service->getError()); } } /** * 退回 * * @return void */ public function actionRefund() { if ($this->request->isAjax) { $id = $this->request->get('id'); return $this->service->refund($id) ? $this->success('ok') : $this->error($this->service->getError()); } } /** * 服务商版本记账本退回 * * @param integer $id * @return string */ public function actionReturn(int $id) { $data = $this->request->post(); $validate = Yii::$app->services->validate->validate($data, [ [['amount', 'account_name', 'account_number'], 'required'], ]); if ($validate === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); return $this->service->refundToAccount($id, $data) ? $this->success('ok') : $this->error($this->service->getError()); } /** * 过流水相关 * * @return mixed */ public function actionPaymentFlow() { return $this->success('ok', $this->service->getPaymentFlow()); } }