WIP Integrazioni delle ultime modifiche. #4
@ -15,8 +15,8 @@ class GenDoc extends Model
|
|||||||
// DocumentiGenerali
|
// DocumentiGenerali
|
||||||
|
|
||||||
public static function saveDocument($data){
|
public static function saveDocument($data){
|
||||||
|
|
||||||
$filename=$data->file('filename')->store(self::getEntityFolder($data['entity']));
|
$filename=$data->file('filename')->store(asset(self::getEntityFolder($data['entity'])));
|
||||||
DB::table('gen_docs')
|
DB::table('gen_docs')
|
||||||
->insert([
|
->insert([
|
||||||
'entity'=>$data['entity'],
|
'entity'=>$data['entity'],
|
||||||
@ -26,14 +26,14 @@ class GenDoc extends Model
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listDocument($entity,$entity_id = 0)
|
public static function listDocument($entity,$entity_id = 1)
|
||||||
{
|
{
|
||||||
// Ritorna la lista dei documenti in base all'entità e al rispettivo id
|
// 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();
|
// return DB::table('documentis')->where('movimenti_id','=', $entity_id)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function countDocument($entity,$entity_id = 0){
|
public static function countDocument($entity,$entity_id = 1){
|
||||||
// Conta i documenti inseriti per la determinata entità e id
|
// Conta i documenti inseriti per la determinata entità e id
|
||||||
$quanti=DB::table('gen_docs')
|
$quanti=DB::table('gen_docs')
|
||||||
->where('entity','=',$entity)
|
->where('entity','=',$entity)
|
||||||
@ -55,7 +55,7 @@ class GenDoc extends Model
|
|||||||
$deleted = GenDoc::where('id',$id)->get();
|
$deleted = GenDoc::where('id',$id)->get();
|
||||||
Storage::delete($deleted[0]->filename);
|
Storage::delete($deleted[0]->filename);
|
||||||
$removed = GenDoc::destroy($id);
|
$removed = GenDoc::destroy($id);
|
||||||
//$removed->detete();
|
//$removed->detete();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user