Commit 33274c32 authored by FARDA ALAN MA'RUF's avatar FARDA ALAN MA'RUF

fixing import guru

parent 04542b53
......@@ -17,7 +17,7 @@ use Maatwebsite\Excel\Facades\Excel;
class ImportTransaksi
{
public static function isNewTeacher($nip, $name)
public static function isNewTeacher($nip, $nuptk, $name)
{
$result = [];
$newTeacher = true;
......@@ -25,14 +25,12 @@ class ImportTransaksi
$status = 1;
$status_user = 1;
$isGuru = ImportDapodikGuruModel::where('nip', $nip)->first();
$isGuru = ImportDapodikGuruModel::where('nip', $nip)->orWhere('nuptk', $nuptk)->first();
if (isset($isGuru)) {
// $newTeacher = false;
$newMsg = "Data dengan NIP " . $nip . " sudah ada !";
$status = 2;
}
if (!is_numeric($nip) || $nip == null || strlen($nip) < 10) {
}else if (!is_numeric($nip) || $nip == null || strlen($nip) < 10) {
$newTeacher = false;
$newMsg = "Data dengan NIP " . $nip . " bukan numeric, data kosong atau nip kurang dari 10 !";
$status = 0;
......@@ -85,7 +83,7 @@ class ImportTransaksi
public static function importGuruSplit($data)
{
$isNewTeacher = self::isNewTeacher($data['nip'], $data['nama']);
$isNewTeacher = self::isNewTeacher($data['nip'], $data['nuptk'], $data['nama']);
$dataArray = [
'idUser' => $data['idUser'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment