v.2.30
Добавлен расширенный отчет по реализации Добавлен монитор активности
This commit is contained in:
@@ -3,12 +3,22 @@
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Places extends Model {
|
||||
protected $table = 'places';
|
||||
public $timestamps = false;
|
||||
|
||||
public static function getName($data) {
|
||||
$places = Places::where('id', $data)->first();
|
||||
/**
|
||||
* Get the tables for the place.
|
||||
*/
|
||||
public function tables(): HasMany
|
||||
{
|
||||
return $this->hasMany(Tables::class, 'place_id');
|
||||
}
|
||||
|
||||
public static function getName($id) {
|
||||
$places = self::where('id', $id)->first();
|
||||
if ($places) {
|
||||
$place_name = $places['name'];
|
||||
} else {
|
||||
@@ -18,5 +28,16 @@ class Places extends Model {
|
||||
return $place_name;
|
||||
}
|
||||
|
||||
public static function getID($name) {
|
||||
$places = self::where('name', $name)->first();
|
||||
if ($places) {
|
||||
$place_id = $places['id'];
|
||||
} else {
|
||||
$place_id = 0;
|
||||
|
||||
}
|
||||
return $place_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user