v.2.22
Редактор карты зала Электронные заказы Отчет по удалениям
This commit is contained in:
@@ -6,4 +6,19 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Staff extends Model {
|
||||
protected $table = 'staffs';
|
||||
|
||||
public static function getName($data) {
|
||||
$staff_name = Staff::where('code', intval($data))->where('is_history', 0)->first();
|
||||
if ($staff_name) {
|
||||
$staff_name = $staff_name['name'];
|
||||
} else {
|
||||
$staff_name = Staff::where('code', intval($data))->where('is_history', 1)->first();
|
||||
if ($staff_name) {
|
||||
$staff_name = $staff_name['name'];
|
||||
} else {
|
||||
$staff_name = 'Связанный персонал не найден';
|
||||
}
|
||||
}
|
||||
return $staff_name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user