delete(); } public static function saveProductImages($productId, $imageUrls) { if (empty($productId) || empty($imageUrl)) { return false; } // 准备数据集合 $data = []; foreach ($imageUrls as $imageUrl) { $data[] = [ 'product_id' => $productId, 'image_url' => $imageUrl, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ]; } // 批量插入 return Model::insert($data); } }