OrderController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace addons\Alitopay\backend\controllers;
  3. use addons\Alitopay\common\services\OrderService;
  4. class OrderController extends BaseController
  5. {
  6. public $service;
  7. public function __construct ($id, $module, $config = [])
  8. {
  9. parent::__construct($id, $module, $config);
  10. $this->service = new OrderService();
  11. }
  12. public function actionIndex(){
  13. if( !$this->request->isAjax ){
  14. return $this->render('index');
  15. }
  16. $param = $this->request->get();
  17. $list = $this->service->list($this->mall_id,$param);
  18. $this->success('ok',$list);
  19. }
  20. // 打款
  21. public function actionToPay(){
  22. $ids = $this->request->get("ids");
  23. $ids = explode(',',$ids);
  24. $res = $this->service->orderToPay($this->mall_id,$ids);
  25. return !$res ? $this->error($this->service->error) : $this->success('ok',['html'=>$res]);
  26. }
  27. // 打款
  28. public function actionQuery(){
  29. $id = $this->request->get("id");
  30. $res = $this->service->orderQuery($id);
  31. return !$res ? $this->error($this->service->error) : $this->success('查询成功,请刷新页面');
  32. }
  33. public function actionApplyBill(){
  34. $id = $this->request->get("id");
  35. $res = $this->service->fundTransCommonQuery($this->mall_id,$id);
  36. return !$res ? $this->error($this->service->error) : $this->success('成功,请刷新页面');
  37. }
  38. }