Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kalendar-unesa
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Febry San
kalendar-unesa
Commits
a5d6c5c4
Commit
a5d6c5c4
authored
Mar 27, 2023
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perbaikan model
parent
e9205cf9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
87 additions
and
28 deletions
+87
-28
app/Models/Agenda.php
+17
-2
app/Models/Attachment.php
+9
-4
app/Models/Kategori.php
+7
-3
app/Models/KategoriDokumen.php
+7
-3
app/Models/Pegawai.php
+10
-3
app/Models/Role.php
+7
-3
app/Models/Unit.php
+12
-5
app/Models/UserAgenda.php
+8
-2
app/Models/Users.php
+10
-3
No files found.
app/Models/Agenda.php
View file @
a5d6c5c4
...
...
@@ -11,7 +11,22 @@ class Agenda extends Model
protected
$table
=
'ms_agenda'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'tanggal'
,
'waktu_mulai'
,
'waktu_selesai'
,
'lokasi'
,
'statusacara'
,
'idunit'
,
'idkategori'
,
'linkzoom'
,
'idattachment'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'userid_created'
,
'userid_updated'
'id'
,
'nama'
,
'tanggal'
,
'waktu_mulai'
,
'waktu_selesai'
,
'lokasi'
,
'statusacara'
,
'idunit'
,
'idkategori'
,
'linkzoom'
,
'idattachment'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'userid_created'
,
'userid_updated'
];
// public function rUserAgenda()
...
...
@@ -21,7 +36,7 @@ class Agenda extends Model
public
function
rUnit
()
{
return
$this
->
hasOne
(
Unit
::
class
,
'idunit'
,
'id'
);
return
$this
->
belongsTo
(
Unit
::
class
,
'idunit'
,
'id'
);
}
public
function
rKategori
()
...
...
app/Models/Attachment.php
View file @
a5d6c5c4
...
...
@@ -11,16 +11,21 @@ class Attachment extends Model
protected
$table
=
'ms_attachment'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'id_kategori_dokumen'
,
'updated_at'
,
'created_at'
,
'deleted_at'
,
'id'
,
'nama'
,
'id_kategori_dokumen'
,
'updated_at'
,
'created_at'
,
'deleted_at'
,
];
public
function
rAgenda
()
{
return
$this
->
hasOne
(
Agenda
::
class
,
'id'
,
'idattachment
'
);
return
$this
->
belongsTo
(
Agenda
::
class
,
'idattachment'
,
'id
'
);
}
public
function
rKategoriDokumen
()
{
return
$this
->
hasOne
(
KategoriDokumen
::
class
,
'id_kategori_dokumen'
,
'id'
);
}
}
}
app/Models/Kategori.php
View file @
a5d6c5c4
...
...
@@ -11,11 +11,15 @@ class Kategori extends Model
protected
$table
=
'ms_kategori'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
public
function
rAgenda
()
{
return
$this
->
hasMany
(
Agenda
::
class
,
'id'
,
'idkategori
'
);
}
return
$this
->
belongsToMany
(
Agenda
::
class
,
'idkategori'
,
'id
'
);
}
}
app/Models/KategoriDokumen.php
View file @
a5d6c5c4
...
...
@@ -11,11 +11,15 @@ class KategoriDokumen extends Model
protected
$table
=
'ms_kategori_attachment'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
public
function
rAttachment
()
{
return
$this
->
hasMany
(
Attachment
::
class
,
'id'
,
'id_kategori_dokumen
'
);
}
return
$this
->
belongsToMany
(
Attachment
::
class
,
'id_kategori_dokumen'
,
'id
'
);
}
}
app/Models/Pegawai.php
View file @
a5d6c5c4
...
...
@@ -11,7 +11,14 @@ class Pegawai extends Model
protected
$table
=
'pegawai'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'nip'
,
'idunit'
,
'statusaktif'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'nama'
,
'nip'
,
'idunit'
,
'statusaktif'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
// public function rUserAgenda()
...
...
@@ -21,12 +28,12 @@ class Pegawai extends Model
public
function
rUnit
()
{
return
$this
->
hasOne
(
Unit
::
class
,
'idunit'
,
'id'
);
return
$this
->
belongsTo
(
Unit
::
class
,
'idunit'
,
'id'
);
}
public
function
rUsers
()
{
return
$this
->
hasOne
(
Users
::
class
,
'id
'
,
'idpegawai
'
);
return
$this
->
hasOne
(
Users
::
class
,
'id
pegawai'
,
'id
'
);
}
public
function
rAgenda
()
...
...
app/Models/Role.php
View file @
a5d6c5c4
...
...
@@ -11,11 +11,15 @@ class Role extends Model
protected
$table
=
'role'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'nama'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
public
function
rUser
()
{
return
$this
->
hasMany
(
Users
::
class
,
'id'
,
'idrole
'
);
return
$this
->
belongsToMany
(
Users
::
class
,
'idrole'
,
'id
'
);
}
}
app/Models/Unit.php
View file @
a5d6c5c4
...
...
@@ -11,16 +11,23 @@ class Unit extends Model
protected
$table
=
'ms_unit'
;
protected
$fillable
=
[
'id'
,
'idsatker'
,
'idparentsatker'
,
'namasatker'
,
'status'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'idsatker'
,
'idparentsatker'
,
'namasatker'
,
'status'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
public
function
rAgenda
()
{
return
$this
->
hasMany
(
Agenda
::
class
,
'id
'
,
'idunit
'
);
}
return
$this
->
hasMany
(
Agenda
::
class
,
'id
unit'
,
'id
'
);
}
public
function
rPegawai
()
{
return
$this
->
hasMany
(
Pegawai
::
class
,
'id
'
,
'idunit
'
);
}
return
$this
->
hasMany
(
Pegawai
::
class
,
'id
unit'
,
'id
'
);
}
}
app/Models/UserAgenda.php
View file @
a5d6c5c4
...
...
@@ -11,7 +11,13 @@ class UserAgenda extends Model
protected
$table
=
'tr_agenda_pegawai'
;
protected
$fillable
=
[
'id'
,
'idpegawai'
,
'idagenda'
,
'statuskehadiran'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
'id'
,
'idpegawai'
,
'idagenda'
,
'statuskehadiran'
,
'created_at'
,
'updated_at'
,
'deleted_at'
,
];
// public function rPegawai()
...
...
@@ -22,5 +28,5 @@ class UserAgenda extends Model
// public function rAgenda()
// {
// return $this->hasOne(UserAgenda::class, 'idagenda', 'id');
// }
// }
}
app/Models/Users.php
View file @
a5d6c5c4
...
...
@@ -11,16 +11,23 @@ class Users extends Model
protected
$table
=
'user'
;
protected
$fillable
=
[
'id'
,
'nama'
,
'email'
,
'password'
,
'idrole'
,
'idpegawai'
,
'created_at'
,
'updated_at'
,
'id'
,
'nama'
,
'email'
,
'password'
,
'idrole'
,
'idpegawai'
,
'created_at'
,
'updated_at'
,
];
public
function
rRole
()
{
return
$this
->
belongsTo
(
Role
::
class
,
'idrole'
,
'id'
);
return
$this
->
hasOne
(
Role
::
class
,
'idrole'
,
'id'
);
}
public
function
rPegawai
()
{
return
$this
->
hasOne
(
Pegawai
::
class
,
'idpegawai'
,
'id'
);
return
$this
->
belongsTo
(
Pegawai
::
class
,
'idpegawai'
,
'id'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment