| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- namespace addons\AvoidTax\backend\controllers;
- use addons\AvoidTax\common\service\OrderService;
- use addons\AvoidTax\common\service\SokabeService;
- /**
- * 测试
- * @package addons\AvoidTax\backend\controllers
- */
- class SokabeController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * @var SokabeService
- */
- protected $service;
- public function init()
- {
- parent::init();
- $this->service = new SokabeService(['mall_id' => $this->mall_id]);
- }
- /**
- * 手续费未成功提交列表
- *
- * @return void
- */
- public function actionTax()
- {
- if ($this->request->isAjax) {
- return $this->success(
- 'ok',
- $this->service->getTaxList(
- array_merge(
- $this->request->getBodyParams(),
- $this->request->get(),
- )
- )
- );
- }
- return $this->render($this->action->id);
- }
- /**
- * 失败列表
- *
- * @return void
- */
- public function actionFail()
- {
- if ($this->request->isAjax) {
- return $this->success(
- 'ok',
- $this->service->getOrderList()
- );
- }
-
- return $this->render($this->action->id);
- }
- /**
- * 重新提交
- *
- * @return void
- */
- public function actionResub()
- {
- if ($this->request->isAjax) {
- // id
- $id = $this->request->get('id');
- return $this->service->resub($id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- }
- /**
- * 失败
- *
- * @return void
- */
- public function actionToFail(int $id)
- {
- return $this->service->toFail($id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- /**
- * 成功
- *
- * @return void
- */
- public function actionSuccess(int $id)
- {
- $this->service->toSuccess($id);
- }
- /**
- * @return mixed
- */
- public function actionList()
- {
- if ($this->request->isAjax) {
- return $this->success(
- 'ok',
- $this->service->getList(
- array_merge(
- $this->request->get(),
- )
- )
- );
- }
- return $this->render($this->action->id);
- }
- /**
- * 提交成功
- *
- * @param integer $id
- * @return mixed
- */
- public function actionSubSuccess(int $id)
- {
- return $this->service->subSuccess($id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- /**
- * 提交失败
- *
- * @param integer $id
- * @return mixed
- */
- public function actionSubFail(int $id)
- {
- return $this->service->subFial($id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- }
|