mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Miglioramenti minori
This commit is contained in:
parent
4d923b81e0
commit
24f101fb8e
@ -82,7 +82,7 @@ switch (post('op')) {
|
||||
|
||||
// Validazione della Partita IVA
|
||||
$partita_iva = $anagrafica->partita_iva;
|
||||
$partita_iva = strlen($partita_iva) == 9 ? $anagrafica->nazione->iso2.$partita_iva : $partita_iva;
|
||||
$partita_iva = strlen($partita_iva) == 11 ? $anagrafica->nazione->iso2.$partita_iva : $partita_iva;
|
||||
|
||||
$check_vat_number = Validate::isValidVatNumber($partita_iva);
|
||||
if (empty($check_vat_number)) {
|
||||
|
@ -15,6 +15,7 @@ class Module extends Model
|
||||
|
||||
protected $table = 'zz_modules';
|
||||
protected $main_folder = 'modules';
|
||||
protected $upload_identifier = 'id_module';
|
||||
|
||||
protected $appends = [
|
||||
'permission',
|
||||
|
@ -15,6 +15,7 @@ class Plugin extends Model
|
||||
|
||||
protected $table = 'zz_plugins';
|
||||
protected $main_folder = 'plugins';
|
||||
protected $upload_identifier = 'id_plugin';
|
||||
|
||||
protected $appends = [
|
||||
'permission',
|
||||
|
21
src/Models/Upload.php
Normal file
21
src/Models/Upload.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Models;
|
||||
|
||||
use Traits\StoreTrait;
|
||||
use Common\Model;
|
||||
|
||||
class Upload extends Model
|
||||
{
|
||||
protected $table = 'zz_files';
|
||||
|
||||
public function module()
|
||||
{
|
||||
return $this->belongsTo(Module::class, 'id_module');
|
||||
}
|
||||
|
||||
public function plugin()
|
||||
{
|
||||
return $this->belongsTo(Plugin::class, 'id_plugin');
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace Traits;
|
||||
|
||||
use Models\Upload;
|
||||
|
||||
trait UploadTrait
|
||||
{
|
||||
/**
|
||||
@ -13,4 +15,9 @@ trait UploadTrait
|
||||
{
|
||||
return 'files/'.$this->directory;
|
||||
}
|
||||
|
||||
public function uploads($id_record)
|
||||
{
|
||||
return $this->hasMany(Upload::class, $this->upload_identifier)->where('id_record', $id_record)->get()->groupBy('category');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user