1. Редактор карты зала.
This commit is contained in:
miroman-afk
2022-10-27 15:48:02 +03:00
parent 0e5f2002b1
commit 4d3ad7727d
21 changed files with 625 additions and 192 deletions

View File

@@ -4,15 +4,21 @@ namespace App\Component\Models;
use Illuminate\Database\Eloquent\Model;
class Staff extends Model {
protected $table = 'staffs';
class Staff extends Model
{
protected $table = 'staffs';
public static function getName($data) {
$staff_name = Staff::where('code', intval($data))->where('is_history', 0)->first();
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();
$staff_name = Staff::where('code', intval($data))
->where('is_history', 1)
->first();
if ($staff_name) {
$staff_name = $staff_name['name'];
} else {