Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint inscrever/matricular aluno no Sagu #44

Merged
merged 23 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Instrução para instalação
- clonar projeto com git clone https://github.com/EscolaDeSaudePublica/sagu-api.git
- `cd sagu-api`.
- rodar o comando `docker-compose exec php-fpm composer install `para instalar as **dependências do composer**
- Abrir navegador em _http://localhost:8085/_

# Configuração
- criar um arquivo .env com base no .env.example
- `docker-compose exec php-fpm php artisan key:generate`. Se não ouver o pacote lumem-generate instalar seguindo as instruções do [link](https://github.com/flipboxstudio/lumen-generator/tree/6.0)
- Depois da permissão nas pasta storage com os seguintes comandos
- `docker exec -it saguapi bash`
- `chown -R $USER:www-data storage`
- `chown -R $USER:www-data bootstrap`
- `chmod -R 775 storage`
- `chmod -R 775 bootstrap`




# Lumen PHP Framework

[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
Expand Down
35 changes: 35 additions & 0 deletions app/DAO/Basico/MioloCustomValueDAO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace App\DAO\Basico;

use Illuminate\Support\Facades\DB;

class MioloCustomValueDAO
{
const FIELD1 = 54;


public static function getContent($personId, $field)
{
$select = DB::select('SELECT DISTINCT value FROM public.miolo_custom_value WHERE customized_id = :customized_id AND custom_field_id = :custom_field_id LIMIT 1',
[
'customized_id' => $personId,
'custom_field_id' => $field
]
);

if (count($select)) {
return $select[0]->value;
}
}

public static function insert($personId, $value)
{
$result = DB::insert('insert into public.miolo_custom_value (customized_id, custom_field_id, value) values (?, ?, ?)',
[
$personId,
self::FIELD1,
$value
]);
}
}
34 changes: 34 additions & 0 deletions app/DAO/DocumentoDAO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App\DAO;

use App\Model\Person;
use Illuminate\Support\Facades\DB;

class DocumentoDAO
{

public static function getContent($personId, $typeDocument)
{
$select = DB::select('SELECT * FROM basdocument WHERE personid = :personid AND documenttypeid = :documenttypeid LIMIT 1',
[
'personid' => $personId,
'documenttypeid' => $typeDocument
]
);

if (count($select)) {
return $select[0]->content;
}
}

public static function insertDocumento($personId, $tipoDocumento, $content)
{
return DB::insert("insert into basdocument (personid, documenttypeid, content, isDelivered) values (?, ? , ?, ?)", [
$personId,
$tipoDocumento,
$content,
't'
]);
}
}
Loading