| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace addons\AvoidTax\backend\controllers;
- use addons\AvoidTax\common\models\TaxOrder;
- use addons\AvoidTax\common\service\FeeService;
- use addons\AvoidTax\common\service\OrderService;
- use common\enums\DownloadEnum;
- use common\helpers\csv\CsvExportHelper;
- use Yii;
- /**
- * 手续费相关
- *
- * Class FeeController
- * @package addons\AvoidTax\backend\controllers
- */
- class FeeController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * @var FeeService
- */
- protected $service;
- public function init()
- {
- parent::init();
- $this->service = new FeeService(['mall_id' => $this->mall_id]);
- }
- /**
- * 交易列表
- *
- * @return
- */
- public function actionIndex()
- {
- if ($this->request->isAjax && $this->request->isGet) {
- $params = $this->request->getQueryParams();
- $list = $this->service->getOrderFeeList($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_TAX;
- $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 actionDetail()
- {
- if ($this->request->isAjax) {
- $num = $this->request->get('num');
- return $this->success('ok', $this->service->getOrderDetail($num));
- }
- }
- }
|