OrderController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace addons\Sicpay\backend\controllers;
  3. use addons\Sicpay\common\services\OrderService;
  4. use addons\Sicpay\common\services\PayService;
  5. class OrderController extends BaseController
  6. {
  7. public $enableCsrfValidation = false;
  8. public $service;
  9. public function __construct ($id, $module, $config = [])
  10. {
  11. parent::__construct($id, $module, $config);
  12. $this->service = new OrderService(['mall_id'=>$this->mall_id]);
  13. }
  14. public function actionIndex(){
  15. if(!$this->request->isAjax){
  16. return $this->render('index');
  17. }
  18. $param = $this->request->get();
  19. $list = $this->service->lists($param);
  20. return $this->success('ok',$list);
  21. }
  22. public function actionQuery(){
  23. $order_no = $this->request->get('order_no');
  24. $service = new PayService(['mall_id'=>$this->mall_id]);
  25. $res = $service->query($order_no);
  26. return $res ? $this->success('操作成功,请刷新页面',$res) : $this->error($service->error);
  27. }
  28. }