#5 messo nei commenti le proposte di cambiamento da effettuare per la generalizzazione dei documenti
This commit is contained in:
parent
717e1be95d
commit
a174a31b0d
@ -16,6 +16,14 @@ class Documenti extends Model
|
||||
->count();
|
||||
return $quanti;
|
||||
}
|
||||
|
||||
// Proposta modifica issue #5 gitea (generalizzazione del documento)
|
||||
/*
|
||||
public static function countDocument($id,$entity)
|
||||
{
|
||||
return self::where('entita','=',$entity)->where('entita_id','=',$id)->count();
|
||||
}
|
||||
*/
|
||||
|
||||
public static function store($req) {
|
||||
$movimento_id=$req->input('id');
|
||||
@ -27,6 +35,20 @@ class Documenti extends Model
|
||||
'filename'=>$filename,
|
||||
]);
|
||||
}
|
||||
|
||||
// Proposta modifica issue #5 gitea (generalizzazione del documento)
|
||||
/*
|
||||
public static function store($req) {
|
||||
$movimento_id=$req->input('id');
|
||||
$filename=$req->file('filename')->store('Documenti');
|
||||
self::create([
|
||||
'entità'=>$req['entita'], // aggiunto per determinare il tipo di entità a cui si riferisce il documento
|
||||
'entita_id'=>$req['entita_id'], // aggiunto per identificare il record al quale associare il documento (al posto di id_movimento)
|
||||
'descrizione'=>$descrizione,
|
||||
'filename'=>$filename
|
||||
]);
|
||||
}
|
||||
*/
|
||||
|
||||
public static function getList($id)
|
||||
{
|
||||
@ -35,4 +57,11 @@ class Documenti extends Model
|
||||
->get();
|
||||
}
|
||||
|
||||
// Proposta modifica issue #5 gitea (generalizzazione del documento)
|
||||
/*
|
||||
public static function getList($id,$entity)
|
||||
{
|
||||
self::where('entita','=',$entity)->where('entita_id','=',$id)->get();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -20,6 +20,18 @@ class CreateDocumentisTable extends Migration
|
||||
$table->string('descrizione');
|
||||
$table->string('filename');
|
||||
});
|
||||
|
||||
/*
|
||||
ISSUE #5 GITEA - proposta modifica
|
||||
Schema::create('documentis', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->string('entita');
|
||||
$table->bigInteger('entita_id');
|
||||
$table->string('descrizione');
|
||||
$table->string('filename');
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user