v.2.24
1. POSTBonus in/out 2. POSTPresale in/out 3. Переработана форма гостя
This commit is contained in:
@@ -4,12 +4,25 @@ 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 = [];
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user