cqpCow пре 1 година
родитељ
комит
b02f021873
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      app/Service/ProductService.php

+ 7 - 0
app/Service/ProductService.php

@@ -384,6 +384,12 @@ class ProductService extends Service
                 ->where('del_time',0)
                 ->update(['del_time' => $time]);
 
+            $old = ProductInfo::where('del_time',0)
+                ->where('product_id',$data['id'])
+                ->select('file')
+                ->get()->toArray();
+            $old = array_column($old,'file');
+
             ProductInfo::where('del_time',0)
                 ->where('product_id',$data['id'])
                 ->update(['del_time' => $time]);
@@ -400,6 +406,7 @@ class ProductService extends Service
             return [false,$exception->getMessage()];
         }
 
+        $this->delStorageFile($old,[]);
         return [true,''];
     }