update all controllers for kadar anggota koperasi
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Blacklist;
|
||||
use App\AuditCustomer;
|
||||
use Illuminate\Http\Request;
|
||||
use App\TuntutBaki;
|
||||
use App\Anggota;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -393,12 +394,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();
|
||||
|
||||
@@ -825,6 +852,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();
|
||||
|
||||
Reference in New Issue
Block a user