Files
admin-php-module/models/Units.php
miroman-afk d24bba305f v.2.24
1. POSTBonus in/out
2. POSTPresale in/out
3. Переработана форма гостя
2022-12-14 12:42:39 +03:00

28 lines
616 B
PHP

<?php
namespace App\Component\Models;
use Illuminate\Database\Eloquent\Model;
class Units extends Model
{
protected $table = 'units';
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = [];
public static function getName($data)
{
$unit_in_list = UnitsList::where('id', $data)->first();
$unit_name = Units::where('id', $unit_in_list['unit_id'])->first();
if ($unit_name) {
$unit_name = $unit_name['name'];
} else {
$unit_name = 'шт';
}
return $unit_name;
}
}