Добавлен расширенный отчет по реализации
Добавлен монитор активности
This commit is contained in:
miroman-afk
2023-08-03 11:05:15 +03:00
parent 19ad7d1c8a
commit c4dc6e02a0
93 changed files with 13328 additions and 1122 deletions

View File

@@ -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;
}
}