| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace addons\QiJuhe\backend\controllers;
- use addons\QiJuhe\common\service\OrderService;
- use addons\QiJuhe\common\service\RefundService;
- /**
- * 售后
- */
- class RefundController extends BaseController
- {
- /**
- * 首页
- *
- * @return string
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- $params = $this->request->post();
- $service = new RefundService(['mall_id' => $this->mall_id]);
- return $this->success('ok', $service->getList($params));
- }
- return $this->render('index');
- }
- /**
- * 同意申请
- *
- * @return string
- */
- public function actionAgree()
- {
- if ($this->request->isAjax) {
- $id = $this->request->getBodyParam('id');
- $service = new RefundService(['mall_id' => $this->mall_id]);
- return $service->agree([$id], $this->request->getBodyParam('amount', 0), $this->request->getBodyParam('refund_way'))
- ? $this->success('ok')
- : $this->error('推送失败');
- }
- }
-
- /**
- * 驳回申请
- *
- * @return string
- */
- public function actionReject()
- {
- if ($this->request->isAjax) {
- $id = $this->request->getBodyParam('id');
- $service = new RefundService(['mall_id' => $this->mall_id]);
- return $service->reject([$id])
- ? $this->success('ok')
- : $this->error('操作失败');
- }
- }
- }
|