xieruidong %!s(int64=2) %!d(string=hai) anos
pai
achega
8573dac783
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      application/api/controller/mall/GoodsEval.php

+ 6 - 0
application/api/controller/mall/GoodsEval.php

@@ -70,6 +70,12 @@ class GoodsEval extends Api
             'content|内容'=>['require','max:250'],
         ]);
         $user=$this->auth->getUser();
+        $orderCheck=$user->orders()->where('id',$data['order_id'])
+            ->where('status',Orders::S_OVER)
+            ->find();
+        if(!$orderCheck){
+            $this->error('您无法进行评价');
+        }
         $has=\app\common\model\GoodsEval::where('user_id',$user['id'])
             ->where('goods_id',$data['goods_id'])
             ->where('order_id',$data['order_id'])