| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace addons\Sicpay\backend\controllers;
- use addons\Sicpay\common\services\OrderService;
- use addons\Sicpay\common\services\PayService;
- class OrderController extends BaseController
- {
- public $enableCsrfValidation = false;
- public $service;
- public function __construct ($id, $module, $config = [])
- {
- parent::__construct($id, $module, $config);
- $this->service = new OrderService(['mall_id'=>$this->mall_id]);
- }
- public function actionIndex(){
- if(!$this->request->isAjax){
- return $this->render('index');
- }
- $param = $this->request->get();
- $list = $this->service->lists($param);
- return $this->success('ok',$list);
- }
- public function actionQuery(){
- $order_no = $this->request->get('order_no');
- $service = new PayService(['mall_id'=>$this->mall_id]);
- $res = $service->query($order_no);
- return $res ? $this->success('操作成功,请刷新页面',$res) : $this->error($service->error);
- }
- }
|