upgraded new changes

This commit is contained in:
Inshal
2024-10-27 02:14:52 +05:00
parent 2ba27c9ba8
commit c22c3b1e98
41 changed files with 443 additions and 253 deletions

View File

@@ -1705,9 +1705,9 @@ class PatientController extends Controller
}
public function planProductUpdateMultiple(Request $request)
{
$products = $request->input('products');
$products = $request->input('body');
foreach ($products as $productData) {
foreach ($products['products'] as $productData) {
$product_id = $productData['product_id'];
$product_name = $productData['product_name'];
$product_slug = $productData['product_slug'];
@@ -1715,10 +1715,7 @@ class PatientController extends Controller
$product_category = $productData['product_category'];
$product_image = $productData['product_image'];
self::product_category($product_category,$product_id);
$plan = PlanV1::find($product_id);
if ($plan) {
// Update existing product
$plan->title = $product_name;
@@ -1744,6 +1741,7 @@ class PatientController extends Controller
$plan->price = $product_price;
$plan->save();
}
self::product_category($product_category,$product_id);
}
return response()->json(['message' => 'Products updated successfully']);
}
@@ -1771,7 +1769,6 @@ class PatientController extends Controller
$categorySave->category_name = $category_name[$key];
$categorySave->save();
}
ProductCategory::create([
'product_id' => $product_id,
'category_id' => $cat_id