PC-20230314RMCU\Administrator %!s(int64=2) %!d(string=hai) anos
pai
achega
e13ed7bdf9

+ 1 - 0
addons/shopro/model/OrderAction.php

@@ -41,5 +41,6 @@ class OrderAction extends Model
         $self->remark = $remark;
         $self->save();
 
+        return $self;
     }
 }

+ 2 - 2
application/api/controller/shop/Order.php

@@ -165,12 +165,12 @@ class Order extends Base
         if (!isset($params['list']) || empty($params['list'])) {
             $this->error('参数错误');
         }
-        var_dump($params['list']);die;
         // 表单验证
 //        $this->shoproValidate($params, get_class(), 'comment');
         foreach ($params['list'] as $v) {
-            $this->success('评价成功', \app\api\model\order\Order::operComment($v));
+            \app\api\model\order\Order::operComment($v);
         }
+        $this->success('评价成功');
     }
 
     /**

+ 2 - 2
application/api/model/order/OrderOper.php

@@ -873,8 +873,8 @@ trait OrderOper
             OrderAction::operAdd($order, $item, $user, 'user', '用户评价成功');
 
             // 订单评价后
-//            $data = ['order' => $order, 'item' => $item];
-//            \think\Hook::listen('order_comment_after', $data);
+            $data = ['order' => $order, 'item' => $item];
+            \think\Hook::listen('order_comment_after', $data);
         });
     }