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

@@ -43,4 +43,20 @@ class Dishes extends Model {
}
return $isReal;
}
public static function isServing($data) {
$dish_isServing = Dishes::where('code', $data)->where('is_history', 0)->first();
$isServing = 0;
if ($dish_isServing) {
$isServing = intval($dish_isServing['is_serving']);
} else {
$dish_isServing = Dishes::where('code', $data)->where('is_history', 1)->first();
if ($dish_isServing) {
$isServing = intval($dish_isServing['is_serving']);
} else {
$isServing = 0;
}
}
return $isServing;
}
}

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 {