Browse Source

Merge branch 'master' of http://git.huxiukeji.com/lizhen/xiaoshan

Panda 4 tháng trước cách đây
mục cha
commit
773fce4526

+ 0 - 1
addons/shopro/controller/Cart.php

@@ -70,7 +70,6 @@ class Cart extends Common
         $params = $this->request->only(['goods_id', 'goods_sku_price_id', 'goods_num', 'type']);
         $goods_num = $params['goods_num'] ?? 1;
         $type = $params['type'] ?? 'inc';
-        $type = 'cover';
 
         if($goods_num < 1){
             $this->error('数量错误');

+ 1 - 0
addons/shopro/controller/Coupon.php

@@ -57,6 +57,7 @@ class Coupon extends Common
             ->goods($goods)       // 符合指定商品,并且检测商品所属分类
             ->order('id', 'desc');
 
+        //这里注释是因为多重循环导致不必要的数据结构
         /*if ($user) {
             // 关联用户优惠券
             $coupons = $coupons->with(['userCoupons']);

+ 7 - 1
addons/shopro/controller/activity/Groupon.php

@@ -21,12 +21,18 @@ class Groupon extends Common
         $goods_id = $params['goods_id'] ?? 0;
         $activity_id = $params['activity_id'] ?? 0;
 
-        $groupons = GrouponModel::with('leader')->ing()
+        $groupons = GrouponModel::with('grouponLogs')->ing()
             ->where('goods_id', $goods_id)
             ->where('activity_id', $activity_id)
             ->order('id', 'asc')
 //            ->paginate($this->request->param('list_rows', 10));
             ->autopage()->select();
+        $groupons = json_decode(json_encode($groupons),true);
+        foreach($groupons as $key => $groupon){
+            $groupon['expire_second'] = strtotime($groupon['expire_time']) - time();
+
+            $groupons[$key] = $groupon;
+        }
         $this->success('获取成功', $groupons);
     }
 

+ 9 - 2
addons/shopro/controller/data/Express.php

@@ -27,10 +27,17 @@ class Express extends Common
      */
     public function index()
     {
+        $keyword = input('keyword','');
+
+        $map = [];
+        if(!empty($keyword)){
+            $map['name'] = ['LIKE','%'.$keyword.'%'];
+        }
+
         $model = new \app\admin\model\shopro\data\Express;
 
-        $list = $model->sheepFilter()->select();
-        $this->success('', null, $list);
+        $list = $model->sheepFilter()->where($map)->select();
+        $this->success(1, $list);
     }
 
 

+ 3 - 0
addons/shopro/controller/goods/Goods.php

@@ -202,6 +202,9 @@ class Goods extends Common
         $goods['content'] = $content;
         unset($goods['new_sku_prices']);
 
+        //评价数量
+        $goods['comment_number'] = Db::name('shopro_goods_comment')->where('goods_id',$id)->where('status','normal')->where('deletetime',NULL)->count('id');
+
         $this->success('获取成功', $goods);
     }
 

+ 88 - 17
addons/shopro/controller/order/Aftersale.php

@@ -50,6 +50,14 @@ class Aftersale extends Common
             ->autopage()->select();
 //            ->paginate($this->request->param('list_rows', 10));
 
+        //综合状态
+        foreach($aftersales as $key => $aftersale){
+
+            $aftersale['status_show_text'] = $aftersale['aftersale_status_text'].','.$aftersale['refund_status_text'];
+
+            $aftersales[$key] = $aftersale;
+        }
+
         $this->success('获取成功', $aftersales);
     }
 
@@ -65,6 +73,13 @@ class Aftersale extends Common
             $this->error(__('No Results were found'));
         }
 
+        //寄回地址
+        $aftersale_address = Db::name('shopro_aftersale_address')->order('is_default','desc')->order('id desc')->find();
+        $aftersale['aftersale_address'] = $aftersale_address;
+
+        //综合状态
+        $aftersale['status_show_text'] = $aftersale['aftersale_status_text'].','.$aftersale['refund_status_text'];
+
         $this->success('获取成功', $aftersale);
     }
 
@@ -85,21 +100,15 @@ class Aftersale extends Common
             $content = $params['content'] ?? '';
             $images = $params['images'] ? json_decode(htmlspecialchars_decode($params['images']),true) : [];
 
-            //寄回信息
-            $express_id = $params['express_id'] ?? 0;
-            $express_no = $params['express_no'] ?? '';
-            if($type == 'return'){
-                if(!$express_id || !$express_no){
-                    error_stop('请输入快递公司和运单号');
-                }
-
-                $express = Db::name('shopro_data_express')->where('id',$express_id)->find();
-                if(!$express){
-                    error_stop('请输入快递公司和运单号');
-                }
+            //申请退款金额
+            $refund_money = round(floatval($params['apply_refund_price']), 2);
+            if ($refund_money <= 0) {
+                $this->error('请输入正确的退款金额');
             }
 
 
+
+
             //订单状态:已支付,已完成
             $order = OrderModel::canAftersale()->where('user_id', $user->id)->lock(true)->where('id', $order_id)->find();
             if (!$order) {
@@ -119,6 +128,24 @@ class Aftersale extends Common
                 error_stop('当前订单商品不可申请售后');
             }
 
+            //apply_refund_price 限制金额
+            $ordernew = OrderModel::withTrashed()->with('items')->find($order_id);
+            if (!$ordernew) {
+                $this->error('订单不存在');
+            }
+            $items = $ordernew->items;
+            $items = array_column($items, null, 'id');
+
+            // 当前订单已退款总金额
+            $refunded_money = array_sum(array_column($items, 'refund_fee'));
+            // 剩余可退款金额
+            $refund_surplus_money = bcsub($order->pay_fee, (string)$refunded_money, 2);
+            // 如果退款金额大于订单支付总金额
+            if (bccomp((string)$refund_money, $refund_surplus_money, 2) === 1) {
+                $this->error('退款总金额不能大于实际支付金额');
+            }
+
+
             $aftersale = new AftersaleModel();
             $aftersale->aftersale_sn = get_sn($user->id, 'A');
             $aftersale->user_id = $user->id;
@@ -141,15 +168,12 @@ class Aftersale extends Common
             $aftersale->dispatch_fee = $item['dispatch_fee'];
             $aftersale->aftersale_status = AftersaleModel::AFTERSALE_STATUS_NOOPER; // 未处理
             $aftersale->refund_status = AftersaleModel::REFUND_STATUS_NOREFUND;      // 未退款
+            $aftersale->apply_refund_price = $refund_money;
             $aftersale->refund_fee = 0;
             $aftersale->reason = $reason;
             $aftersale->content = $content;
 
-            if($type == 'return'){
-                $aftersale->express_name = $express['name'];
-                $aftersale->express_code = $express['code'];
-                $aftersale->express_no   = $express_no;
-            }
+
 
             $aftersale->save();
 
@@ -174,6 +198,53 @@ class Aftersale extends Common
         $this->success('申请成功', $aftersale);
     }
 
+    //售后寄回
+    public function send(){
+        $user = auth_user();
+
+        $id         = input('id',0,'intval');
+        $express_id = input('express_id',0,'intval');
+        $express_no = input('express_no','','intval');
+        if(!$id || !$express_id || !$express_no){
+            $this->error();
+        }
+
+        $express = Db::name('shopro_data_express')->where('id',$express_id)->find();
+        if(!$express){
+            $this->error('请输入正确的快递公司');
+        }
+
+
+        $aftersale = Db::name('shopro_order_aftersale')->where('id',$id)->where('user_id',$user['id'])->find();
+        if (!$aftersale) {
+            $this->error('售后订单不存在');
+        }
+
+        if($aftersale['type'] != 'return'){
+            $this->error('退货退款的订单才需要寄回商品');
+        }
+
+        // 同意并处理中
+        if($aftersale['aftersale_status'] != AftersaleModel::AFTERSALE_STATUS_ING){
+            $this->error('商家还没有同意售后');
+        }
+
+        // 不要重复寄回
+        if(!empty($aftersale['express_no'])){
+            $this->error('已经寄回了无需重复操作');
+        }
+
+        $data = [
+            'express_name' => $express['name'],
+            'express_code' => $express['code'],
+            'express_no'   => $express_no,
+        ];
+        $rs = Db::name('shopro_order_aftersale')->where('id',$id)->update($data);
+
+        $this->success('操作成功');
+
+    }
+
     //取消售后
     public function cancel()
     {

+ 23 - 1
addons/shopro/controller/order/Order.php

@@ -33,7 +33,7 @@ class Order extends Common
                 $orders = $orders->paid()->nosend()->groupon_ing();
                 break;
             case 'nosend':
-                $orders = $orders->pretendPaid()->nosend();
+                $orders = $orders->pretendPaid()->nosend()->groupon_finish();
                 break;
             case 'noget':
                 $orders = $orders->pretendPaid()->noget();
@@ -201,6 +201,28 @@ class Order extends Common
     public function coupons() 
     {
         $params = $this->request->param();
+
+        //购物车
+        $cart = input('cart',0);
+        if(!empty($cart)){
+            unset($params['goods_list']);
+            // 多个商品
+            $carts = (new \app\admin\model\shopro\Cart)
+                ->whereIn('id', $cart)
+                ->order(['id' => 'desc'])
+                ->select();
+            $goods_list = [];
+            foreach ($carts as $cart) {
+                $goods_list[] = [
+                    'goods_id'           => $cart['goods_id'],
+                    'goods_sku_price_id' => $cart['goods_sku_price_id'],
+                    'goods_num'          => $cart['goods_num'],
+                ];
+            }
+            $params['goods_list'] = empty($goods_list) ? '' : json_encode($goods_list);
+        }
+        //购物车
+
         $this->svalidate($params, ".create");
 
         $orderCreate = new OrderCreate($params);

+ 1 - 0
addons/shopro/service/order/OrderCreate.php

@@ -611,6 +611,7 @@ class OrderCreate
         $this->calcAmount();
 
         // 用户可用优惠券列表
+        // 这里使用的with,没法用 coupon表的减免金额做排序,可能需要重新写
         $coupons = Coupon::with('coupon')->where('user_id', $this->user->id)->canUse()->select();
 
         $cannot_use = [];

+ 8 - 5
addons/shopro/service/pay/PayOper.php

@@ -108,7 +108,7 @@ class PayOper
         ]);
 
         // 余额直接支付成功,更新订单剩余应付款金额,并检测订单状态
-        return $this->checkAndPaid($order, $order_type);
+        return $this->checkAndPaid($order, $order_type, 'online', 'money');
     }
 
 
@@ -152,7 +152,7 @@ class PayOper
         ]);
 
         // 积分直接支付成功,更新订单剩余应付款金额,并检测订单状态
-        return $this->checkAndPaid($order, $order_type);
+        return $this->checkAndPaid($order, $order_type, 'online', 'score');
     }
 
 
@@ -178,7 +178,7 @@ class PayOper
         ]);
 
         // 更新订单剩余应付款金额,并检测订单状态
-        return $this->checkAndPaid($order, $order_type, 'offline');
+        return $this->checkAndPaid($order, $order_type, 'offline', 'offline');
     }
 
 
@@ -208,7 +208,7 @@ class PayOper
         }
 
         if ($order->status == $order::STATUS_UNPAID) {      // 未支付,检测支付状态
-            $order = $this->checkAndPaid($order, $pay->order_type);
+            $order = $this->checkAndPaid($order, $pay->order_type, 'online', $pay->pay_type);
         }
 
         return $order;
@@ -223,7 +223,7 @@ class PayOper
      * @param string $order_type
      * @return think\Model
      */
-    public function checkAndPaid($order, $order_type, $pay_mode = 'online')
+    public function checkAndPaid($order, $order_type, $pay_mode = 'online', $pay_type = '')
     {
         // 获取订单已支付金额
         $payed_fee = $this->getPayedFee($order, $order_type);
@@ -236,6 +236,9 @@ class PayOper
             $order->remain_pay_fee = 0;
             $order->paid_time = time();
             $order->status = $order::STATUS_PAID;
+
+            //冗余支付方式到order表
+            $order->pay_type = $pay_type;
         } else {
             if ($pay_mode == 'offline') {
                 // 订单未支付成功,并且是线下支付(货到付款),将订单状态改为 pending

+ 42 - 2
application/admin/controller/shopro/order/Aftersale.php

@@ -157,6 +157,46 @@ class Aftersale extends Common
         $this->success('操作成功', null, $aftersale);
     }
 
+    /**
+     * 同意售后
+     */
+    public function agree($id)
+    {
+        $admin = $this->auth->getUserInfo();
+
+        $aftersale = $this->model->withTrashed()->canOper()->where('id', $id)->find();
+        if (!$aftersale) {
+            $this->error('售后单不存在或不可完成');
+        }
+
+        $order = $this->orderModel->withTrashed()->find($aftersale->order_id);
+        $orderItem = OrderItemModel::find($aftersale->order_item_id);
+        if (!$order || !$orderItem) {
+            $this->error('订单或订单商品不存在');
+        }
+
+        $aftersale = Db::transaction(function () use ($aftersale, $order, $orderItem, $admin) {
+            $aftersale->aftersale_status = OrderAftersaleModel::AFTERSALE_STATUS_ING;    // 售后完成
+            $aftersale->save();
+            // 增加售后单变动记录、
+            OrderAftersaleLogModel::add($order, $aftersale, $admin, 'admin', [
+                'log_type' => 'agree',
+                'content' => '售后订单已同意',
+                'images' => []
+            ]);
+
+            //本来就是这个值
+            $orderItem->aftersale_status = OrderItemModel::AFTERSALE_STATUS_ING;
+            $orderItem->save();
+            OrderActionModel::add($order, $orderItem, $admin, 'admin', '管理员同意售后');
+
+
+            return $aftersale;
+        });
+
+        $this->success('操作成功', null, $aftersale);
+    }
+
 
     /**
      * 拒绝售后
@@ -318,10 +358,10 @@ class Aftersale extends Common
         }
 
         $aftersale = Db::transaction(function () use ($order, $aftersale, $params, $admin) {
-            if ($aftersale['aftersale_status'] == 0) {
+            /*if ($aftersale['aftersale_status'] == 0) {
                 $aftersale->aftersale_status = OrderAftersaleModel::AFTERSALE_STATUS_ING;    // 售后处理中
                 $aftersale->save();
-            }
+            }*/
 
             // 增加售后单变动记录
             OrderAftersaleLogModel::add($order, $aftersale, $admin, 'admin', [

+ 4 - 4
application/admin/model/shopro/order/Aftersale.php

@@ -53,7 +53,7 @@ class Aftersale extends Common
     const AFTERSALE_STATUS_CANCEL = -2;       // 已取消
     const AFTERSALE_STATUS_REFUSE = -1;       // 拒绝
     const AFTERSALE_STATUS_NOOPER = 0;       // 未处理
-    const AFTERSALE_STATUS_ING = 1;       // 申请售后
+    const AFTERSALE_STATUS_ING = 1;       // 同意并处理中
     const AFTERSALE_STATUS_COMPLETED = 2;        // 售后完成
 
 
@@ -87,8 +87,8 @@ class Aftersale extends Common
         return [
             self::AFTERSALE_STATUS_CANCEL => '已取消',
             self::AFTERSALE_STATUS_REFUSE => '拒绝',
-            self::AFTERSALE_STATUS_NOOPER => '未处理',
-            self::AFTERSALE_STATUS_ING => '申请售后',
+            self::AFTERSALE_STATUS_NOOPER => '已申请',
+            self::AFTERSALE_STATUS_ING    => '售后处理中', //售后处理中
             self::AFTERSALE_STATUS_COMPLETED => '售后完成'
         ];
     }
@@ -98,7 +98,7 @@ class Aftersale extends Common
         return [
             self::AFTERSALE_STATUS_CANCEL => '买家取消了售后申请',
             self::AFTERSALE_STATUS_REFUSE => '卖家拒绝了售后申请',
-            self::AFTERSALE_STATUS_NOOPER => '买家申请了售后,请及时处理',
+            self::AFTERSALE_STATUS_NOOPER => '买家申请了售后,等待同意',
             self::AFTERSALE_STATUS_ING => '售后正在处理中',
             self::AFTERSALE_STATUS_COMPLETED => '售后已完成'
         ];

+ 2 - 2
application/admin/model/shopro/order/OrderItem.php

@@ -47,7 +47,7 @@ class OrderItem extends Common
 
 
     // 退款状态
-    const REFUND_STATUS_NOREFUND = 0;       // 退款状态 未申请
+    const REFUND_STATUS_NOREFUND = 0;       // 退款
     const REFUND_STATUS_AGREE = 1;       // 已同意
     const REFUND_STATUS_COMPLETED = 2;       // 退款完成     
 
@@ -80,7 +80,7 @@ class OrderItem extends Common
         return [
             self::AFTERSALE_STATUS_REFUSE => '售后驳回',
             self::AFTERSALE_STATUS_NOAFTER => '未申请',
-            self::AFTERSALE_STATUS_ING => '申请售后',
+            self::AFTERSALE_STATUS_ING => '申请售后', //售后处理中
             self::AFTERSALE_STATUS_COMPLETED => '已完成'
         ];
     }

+ 45 - 0
application/admin/model/shopro/order/traits/OrderScope.php

@@ -114,6 +114,51 @@ trait OrderScope
         );
     }
 
+    //notexists 没成团的订单
+/*
+SELECT
+	*
+FROM
+	`shopro_order`
+WHERE
+	(
+		`user_id` = 11
+		AND ( `status` IN ( 'paid', 'completed' ) OR ( `pay_mode` = 'offline' AND `status` = 'pending' ) )
+		AND `apply_refund_status` IN ( 0,- 1 )
+		AND EXISTS ( SELECT * FROM `shopro_order_item` WHERE ( order_id = shopro_order.id ) AND `dispatch_status` = 0 AND `refund_status` = 0 )
+		AND NOT EXISTS ( SELECT * FROM `shopro_order_item` WHERE ( order_id = shopro_order.id ) AND `aftersale_status` = 1 AND `dispatch_status` = 0 AND `refund_status` = 0 )
+		AND NOT EXISTS (
+		SELECT
+			*
+		FROM
+			`shopro_order` `so`
+		WHERE
+			( so.id = shopro_order.id )
+			AND `so`.`activity_type` = 'groupon'
+			AND `so`.`activity_id` <> 0
+			AND EXISTS ( SELECT * FROM `shopro_activity_groupon` WHERE ( id = so.groupon_id ) AND `status` NOT IN ( 'finish', 'finish_fictitious' ) )
+		)
+	)
+	AND `shopro_order`.`deletetime` IS NULL
+ORDER BY
+	`id` DESC
+	LIMIT 0,
+	10
+ */
+    public function scopegroupon_finish($query){
+        $self_name = (new Order())->getQuery()->getTable();
+        $groupon_name = (new Groupon())->getQuery()->getTable();
+
+        return $query->whereNotExists(function ($query) use ($self_name,$groupon_name) {
+
+                $query->table($self_name)->alias('so')->where('so.id=' . $self_name . '.id')->where('so.activity_type','groupon')->where('so.activity_id','NEQ',0)
+                    ->whereExists(function ($query) use ($groupon_name) {
+                        $query->table($groupon_name)->where('id=so.groupon_id')->where('status','NOTIN',['finish','finish_fictitious']);
+                    });
+        });
+
+    }
+
 
     // 未发货
     public function scopeNosend($query)

+ 42 - 6
application/admin/model/shopro/order/traits/OrderStatus.php

@@ -54,7 +54,7 @@ trait OrderStatus
 
                 $dispatchType = $this->getItemDispatchTypes();
                 if (in_array('express', $dispatchType)) {
-                    //$btns[] = 'express';        // 查看物流
+                    //$btns[] = 'express';        // 查看物流, 放到详情里去了
                 }
                 $backendBtns[] = 'refund';
                 break;
@@ -64,11 +64,11 @@ trait OrderStatus
 
                 $dispatchType = $this->getItemDispatchTypes();
                 if (in_array('express', $dispatchType)) {
-                    //$btns[] = 'express';        // 查看物流
+                    //$btns[] = 'express';        // 查看物流, 放到详情里去了
                 }
                 $btns[] = 'comment';
                 //应该申请售后
-                $btns[] = 'aftersale';
+//                $btns[] = 'aftersale';
                 $backendBtns[] = 'refund';
                 break;
             case 'noget':
@@ -77,7 +77,7 @@ trait OrderStatus
 
                 $dispatchType = $this->getItemDispatchTypes();
                 if (in_array('express', $dispatchType)) {
-                    //$btns[] = 'express';        // 查看物流
+                    //$btns[] = 'express';        // 查看物流, 放到详情里去了
                 }
 
                 if ($this->isOffline($data)) {
@@ -99,7 +99,7 @@ trait OrderStatus
 
                     $btns[] = 'confirm';            // 确认收货
                     //应该申请售后
-                    $btns[] = 'aftersale';
+//                    $btns[] = 'aftersale';
                     $backendBtns[] = 'refund';
                 }
 
@@ -178,7 +178,29 @@ trait OrderStatus
                 }
             }
         }
-        
+
+        //申请售后
+        if (in_array($this->status_code, ['noget', 'nocomment']) && !$this->isOffline($data)) {      // 线下付款订单,不可申请全额退款
+
+                // 获取所有的 item 状态
+                $statusCodes = $this->getItemStatusCode_aftersale('item');
+
+                if(!in_array('refund_agree',$statusCodes) && !in_array('refund_completed',$statusCodes)){
+
+                    $aftersale_times = count($statusCodes);//默认能申请N次
+                    foreach($statusCodes as $key => $statusCode){
+                        if(strpos($statusCode,'aftersale_ing') !== false || strpos($statusCode,'aftersale_completed') !== false){
+                            $aftersale_times--; //减1次
+                        }
+                    }
+
+                    if($aftersale_times != 0){
+                        $btns[] = 'aftersale';    // 申请售后
+                    }
+                }
+
+        }
+
         if ($data['invoice_status'] == 1) {
             $btns[] = 'invoice';    // 查看发票
         }
@@ -286,7 +308,20 @@ trait OrderStatus
 
         // 取出不重复不为空的 status_code
         $statusCodes = array_values(array_unique(array_filter($itemStatusCode)));
+        return $statusCodes;
+    }
+    //和上面一样,除了 array_unique,这里不需要去重
+    private function getItemStatusCode_aftersale($type = 'order')
+    {
+        // 循环判断 item 状态
+        $itemStatusCode = [];
+        foreach ($this->items as $key => $item) {
+            // 获取 item status
+            $itemStatusCode[] = (new OrderItem)->getBaseStatusCode($item, $type);
+        }
 
+        // 取出不重复不为空的 status_code
+        $statusCodes = array_values(array_filter($itemStatusCode));
         return $statusCodes;
     }
 
@@ -323,6 +358,7 @@ trait OrderStatus
 
 
     // 获取订单状态
+    //订单状态:closed=交易关闭,cancel=已取消,unpaid=未支付,paid=已支付,completed=已完成,pending=待定
     public function getStatusCodeAttr($value, $data)
     {
         $status_code = '';

+ 9 - 4
application/admin/view/shopro/order/aftersale/detail.html

@@ -234,15 +234,20 @@
                             {{ state.data.aftersale_status_desc }}
                         </div>
                         <div class="tools">
-                            <template v-if="state.data.aftersale_status == 0 || state.data.aftersale_status == 1">
-                                {if $auth->check('shopro/order/aftersale/refund')}
-                                <el-button type="primary" link @click="onRefund">售后退款</el-button>
+                            <template v-if="state.data.aftersale_status == 0">
+                                {if $auth->check('shopro/order/aftersale/agree')}
+                                <el-button @click="onAgree">同意售后</el-button>
                                 {/if}
                                 {if $auth->check('shopro/order/aftersale/refuse')}
                                 <el-button @click="onRefuse">拒绝售后</el-button>
                                 {/if}
+                            </template>
+                            <template v-if="state.data.aftersale_status == 1">
+                                {if $auth->check('shopro/order/aftersale/refund')}
+                                <el-button @click="onRefund">售后退款</el-button>
+                                {/if}
                                 {if $auth->check('shopro/order/aftersale/completed')}
-                                <el-button type="primary" link @click="onCompleted">售后完成</el-button>
+                                <el-button @click="onCompleted">售后完成</el-button>
                                 {/if}
                             </template>
                         </div>

+ 2 - 2
application/common.php

@@ -595,8 +595,8 @@ if (!function_exists('localpath_to_netpath')) {
         } elseif (strrpos($path, 'http') !== false) {
             return $path;
         } else {
-            return config('pay_notify_url') . str_replace("\\", "/", $path);
-//            return config('upload.cdnurl') . str_replace("\\", "/", $path);
+//            return config('pay_notify_url') . str_replace("\\", "/", $path);
+            return config('upload.cdnurl') . str_replace("\\", "/", $path);
         }
     }
 }

+ 1 - 1
application/extra/upload.php

@@ -9,7 +9,7 @@ return [
     /**
      * CDN地址
      */
-    'cdnurl'    => '',
+    'cdnurl'    => 'https://xiaoshan-1331914430.cos.ap-beijing.myqcloud.com',
     /**
      * 文件保存格式
      */

+ 9 - 0
public/assets/js/backend/shopro/order/aftersale.js

@@ -270,6 +270,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             }
                         })
                     }
+                    function onAgree() {
+                        Fast.api.ajax({
+                            url: `shopro/order/aftersale/agree/id/${state.id}`,
+                            type: 'POST',
+                        }, function (ret, res) {
+                            getDetail()
+                        }, function (ret, res) { })
+                    }
                     function onCompleted() {
                         Fast.api.ajax({
                             url: `shopro/order/aftersale/completed/id/${state.id}`,
@@ -296,6 +304,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         state,
                         onRefund,
                         onRefuse,
+                        onAgree,
                         onCompleted,
                         onAddLog,
                     }