WIP Integrazioni delle ultime modifiche. #4
@ -12,8 +12,6 @@ class GenDoc extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
// DocumentiGenerali
|
||||
|
||||
public static function saveDocument($data){
|
||||
|
||||
// $filename = $data->file('filename')->store(self::getEntityFolder($data['entity']));
|
||||
@ -21,11 +19,11 @@ class GenDoc extends Model
|
||||
$filename = $file->hashName();
|
||||
$path=self::getEntityFolder($data['entity'])."/";
|
||||
$upload = Storage::put($path.$filename,$file);
|
||||
// dd($filename);
|
||||
|
||||
DB::table('gen_docs')
|
||||
->insert([
|
||||
'entity'=>$data['entity'],
|
||||
'entity_id'=>($data['entity_id'] ?? 0 ),
|
||||
'entity_id'=>($data['entity_id'] ?? 1 ),
|
||||
'descrizione'=>$data['descrizione'],
|
||||
'filename'=>$path.$filename,
|
||||
]);
|
||||
@ -34,7 +32,9 @@ class GenDoc extends Model
|
||||
public static function listDocument($entity,$entity_id = 1)
|
||||
{
|
||||
// Ritorna la lista dei documenti in base all'entità e al rispettivo id
|
||||
return DB::table('gen_docs')->where('entity','=',$entity)->where('entity_id','=',$entity_id)->get(); //nuova funzione
|
||||
return DB::table('gen_docs')->where('entity','=',$entity)->where('entity_id','=',$entity_id)->get();
|
||||
//nuova funzione
|
||||
|
||||
// return DB::table('documentis')->where('movimenti_id','=', $entity_id)->get();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user