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,''];
     }