You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
class VisitLog extends CommonModel
|
|
|
|
|
{
|
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
|
|
|
|
|
|
public static function add($admin, $user, $visit_id, $remark)
|
|
|
|
|
{
|
|
|
|
|
return self::create([
|
|
|
|
|
'admin_id' => $admin->id ?? 0,
|
|
|
|
|
'department_id' => $admin->department_id ?? 0,
|
|
|
|
|
'user_id' => $user->id ?? 0,
|
|
|
|
|
'visit_id' => $visit_id,
|
|
|
|
|
'remark' => $remark
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function admin(){
|
|
|
|
|
return $this->hasOne(Admin::class,'id','admin_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function user(){
|
|
|
|
|
return $this->hasOne(User::class,'id','user_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|