corretto path ed Entity_id di default
This commit is contained in:
parent
a7b502bb02
commit
402c566107
@ -12,20 +12,18 @@ class GenDoc extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
// DocumentiGenerali
|
||||
|
||||
public static function saveDocument($data){
|
||||
|
||||
//$filename = $data->file('filename')->store(self::getEntityFolder($data['entity']));
|
||||
// $filename = $data->file('filename')->store(self::getEntityFolder($data['entity']));
|
||||
$file=$data->file('filename');
|
||||
$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,
|
||||
]);
|
||||
@ -33,9 +31,11 @@ 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('documentis')->where('movimenti_id','=', $entity_id)->get();
|
||||
// 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('documentis')->where('movimenti_id','=', $entity_id)->get();
|
||||
}
|
||||
|
||||
public static function countDocument($entity,$entity_id = 1){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user