v.2.24
1. Редактор карты зала.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user