123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\shop\controller\after_sale;
-
-
- use app\common\basics\ShopBase;
- use app\common\server\JsonServer;
- use app\common\model\after_sale\AfterSale as AfterSaleModel;
- use app\shop\logic\after_sale\AfterSaleLogic;
-
-
-
- class AfterSale extends ShopBase
- {
-
-
- public function lists()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- return JsonServer::success('', AfterSaleLogic::list($get, $this->shop_id));
- }
- $data = AfterSaleLogic::list([], $this->shop_id);
-
- $status = AfterSaleModel::getStatusDesc(true);
- $status = AfterSaleLogic::getStatus($status, $this->shop_id);
- $all = AfterSaleLogic::getAll($this->shop_id);
- return view('', [
- 'data' => $data,
- 'all' => $all,
- 'status' => $status
- ]);
- }
-
-
-
- public function detail()
- {
-
- $id = $this->request->get('id');
- $detail = AfterSaleLogic::getDetail($id,$this->shop_id);
- return view('', [
- 'detail' => $detail
- ]);
- }
-
-
-
- public function agree()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- $data = AfterSaleLogic::agree($post['id'], $this->shop_id);
- if($data !== false){
- return JsonServer::success('操作成功');
- }else{
- return JsonServer::error('该退款申请已撤销');
- }
- }
- }
-
-
-
- public function refuse()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- AfterSaleLogic::refuse($post, $this->shop_id);
- return JsonServer::success('操作成功');
- }
-
- }
-
-
-
- public function take()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- AfterSaleLogic::takeGoods($post, $this->admin_id);
- return JsonServer::success('操作成功');
- }
- }
-
-
-
- public function refuseGoods()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- AfterSaleLogic::refuseGoods($post, $this->admin_id);
- return JsonServer::success('操作成功');
- }
- }
-
-
-
-
- public function confirm()
- {
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- $confirm = AfterSaleLogic::confirm($post, $this->admin_id);
- if($confirm !== true){
- return JsonServer::error($confirm,[],0,0);
- }
- return JsonServer::success('操作成功');
- }
- $id = $this->request->get('id');
- $refund_price = $this->request->get('refund_price');
- return view('',['id'=>$id,'refund_price'=>$refund_price]);
- }
-
-
-
-
- public function export()
- {
- $params = $this->request->get();
- $result = AfterSaleLogic::list($params, $this->shop_id, true);
- if(false === $result) {
- return JsonServer::error(AfterSaleLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
- }
|