xieruidong 2 years ago
parent
commit
81db9b3bd0
1 changed files with 7 additions and 1 deletions
  1. 7 1
      application/common/service/OrderService.php

+ 7 - 1
application/common/service/OrderService.php

@@ -113,8 +113,8 @@ class OrderService extends BaseService {
      */
     public function getGoods()
     {
+        $goods=$this->goods;
         if($this->frm==1) {
-            $goods=$this->goods;
             $newGoods=[];
             foreach ($goods as $sku_id=>$info){
                 $sku=GoodsSku::with(['goods'])->find($sku_id);
@@ -140,6 +140,12 @@ class OrderService extends BaseService {
                     $map['goods_sku_id']=['in',$this->cartSkuIds];
                 }
             }
+            foreach ($this->goods as $skuId=>$numArr){
+                $this->getUser()->cart()->where('goods_sku_id',$skuId)->update([
+                    'num'=>$numArr['num'],
+                    'num_install'=>$numArr['num_install'],
+                ]);
+            }
             return $this->getUser()->cart()
                 ->where($map)
                 ->with(['goods','sku'])