Browse Source

核销鉴权

lizhen_gitee 4 tháng trước cách đây
mục cha
commit
f25a32ef15

+ 1 - 1
addons/unishop/model/OrderProduct.php

@@ -33,7 +33,7 @@ class OrderProduct extends Model
     protected $hidden = [
         'user_id',
         'order_id',
-        'product_id'
+//        'product_id'
     ];
 
     protected $append = [

+ 2 - 2
application/api/controller/Hexiao.php

@@ -92,7 +92,7 @@ class Hexiao extends Api
                 }*/
 
                 //限定核销产品
-                if(!in_array($product['product_id'],implode(',',$this->auth->product_ids))){
+                if(!in_array($product['product_id'],explode(',',$this->auth->product_ids))){
                     $this->error('您无法核销当前订单,请移至正确核销点,或联系客服','',2);
                 }
 
@@ -165,7 +165,7 @@ class Hexiao extends Api
         //限定核销产品
         $products = Db::name('unishop_order_product')->where('order_id',$order['id'])->select();
         foreach($products as $key => $product){
-            if(!in_array($product['product_id'],implode(',',$this->auth->product_ids))){
+            if(!in_array($product['product_id'],explode(',',$this->auth->product_ids))){
                 $this->success('您无法核销当前订单,请移至正确核销点,或联系客服','',2);
             }
         }