mark list and custumer data update

This commit is contained in:
Abhishek Mali
2026-03-09 12:04:08 +05:30
parent 9cc6959396
commit 0c51ed1489

View File

@@ -85,7 +85,6 @@ public function approveProfileUpdate($id)
$req = \App\Models\UpdateRequest::findOrFail($id);
$user = \App\Models\User::findOrFail($req->user_id);
// FIX: Ensure data is array
$newData = is_array($req->data) ? $req->data : json_decode($req->data, true);
foreach ($newData as $key => $value) {
@@ -96,8 +95,18 @@ public function approveProfileUpdate($id)
}
}
// Update user table
$user->save();
// Update mark_list table
\App\Models\MarkList::where('customer_id', $user->customer_id)
->update([
'customer_name' => $user->customer_name,
'company_name' => $user->company_name,
'mobile_no' => $user->mobile_no
]);
// Update request status
$req->status = 'approved';
$req->admin_note = 'Approved by admin on ' . now();
$req->save();