update all controllers for kadar anggota koperasi

This commit is contained in:
nurafrinaalimi16
2025-11-10 18:55:17 +08:00
parent 0358878e83
commit fed2cfea72
2 changed files with 217 additions and 2 deletions
+36 -1
View File
@@ -15,6 +15,7 @@ use App\AuditCustomer;
use Illuminate\Http\Request;
use App\TuntutBaki;
use Illuminate\Support\Facades\Auth;
use App\Anggota;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
@@ -394,12 +395,38 @@ class CustomerController extends Controller
'nota_pekerjaan'=>$request->nota_pekerjaan,
// 'nota_arcc'=>$request->nota_arcc,
'telefon' => $request->telefon1,
'telefon2' => $request->telefon2
'telefon2' => $request->telefon2,
));
return response()->json($customer_update, 200);
}
public function assignAnggota($noic, Request $request)
{
// Semak sama ada pelanggan wujud
$customer = Customer::on('mysql7')
->where('kpbaru', $noic)
->orWhere('kplama', $noic)
->first();
if (!$customer) {
return response()->json([
'success' => false,
'message' => 'Pelanggan tidak dijumpai.'
], 404);
}
// Kemaskini tag_anggota
$customer->tag_anggota = 1;
$customer->save();
return response()->json([
'success' => true,
'message' => 'Tag anggota berjaya dikemaskini.',
'data' => $customer
], 200);
}
public function customerUpdateKaunter($nokp,$kodcaw, Request $request){
$current = Carbon::now();
@@ -826,6 +853,14 @@ class CustomerController extends Controller
return response()->json($blacklist);
}
public function anggotaKoperasi(Request $request){
$anggota = Anggota::where('noic',$request->noic)->first();
return response()->json($anggota);
}
public function showCustomerByEachCawangan($ic)
{
$cawangan_all = Cawangan::on('mysql7')->get();