| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace addons\StarChain\backend\controllers;
- use addons\StarChain\common\services\OrderService;
- /**
- * 订单
- */
- class OrderController extends BaseController
- {
- /**
- * 订单列表
- *
- * @return string
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- $params = $this->request->get();
- $service = new OrderService(['mall_id' => $this->mall_id]);
- return ($data = $service->getOrderList($params)) === false
- ? $this->error($service->getErrorMsg())
- : $this->success('ok', $data);
- }
- return $this->render($this->action->id);
- }
- /**
- * 订单详情
- *
- * @return string
- */
- public function actionDetail()
- {
- if ($this->request->isAjax) {
- $id = $this->request->getBodyParam('id');
- $service = new OrderService(['mall_id' => $this->mall_id]);
- return ($data = $service->getOrderDetail($id)) === false
- ? $this->error($service->getErrorMsg())
- : $this->success('ok', $data);
- }
- }
- /**
- * 重新推送订单
- *
- * @param integer $id
- * @return mixed
- */
- public function actionResend(int $id)
- {
- $service = new OrderService(['mall_id' => $this->mall_id]);
- return $service->resendOrder($id) === false
- ? $this->error($service->getErrorMsg())
- : $this->success('ok');
- }
- }
|