https://github.com/fflch/bibfc
https://github.com/fflch/bibfc
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fflch/bibfc
- Owner: fflch
- Created: 2021-10-04T19:53:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T13:59:12.000Z (over 1 year ago)
- Last Synced: 2025-02-01T14:35:19.156Z (over 1 year ago)
- Language: PHP
- Size: 389 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Criar um unidade inicial:
$unidade = new App\Models\Unidade;
$unidade->nome_unidade = 'Unidade Brás';
$unidade->localizacao_unidade = 'São Paulo';
$unidade->save();
Usuário para testes:
$user = new App\Models\User();
$user->password = Hash::make('admin');
$user->email = 'admin@example.com';
$user->name = 'admin';
$user->unidade_id = 1;
$user->save();
Renomeando fotos, o código que vale é o que está depois do underline:
for i in $(ls); do cp $i renomeados/$(echo $i |cut -d'_' -f1).jpg ; done
Import usuários. Colunas do arquivo de usuários: matricula, nome, telefone, situacao, turma:
$usuarios = App\Models\Usuario::all();
foreach($usuarios as $usuario) { $usuario->turma = 'Sem matrícula ativa'; $usuario->save(); }
php artisan importusuarios arquivo.csv
Deletar livros sem exemplar:
Livro::whereDoesntHave('instances')->delete();
Rascunhos:
@each('assuntos.partials.assunto', $assuntos, 'assunto')
update assuntos set parent_id=130 where (parent_id IS NULL and id!=130);
Deletando livros pré-cataloção que começam com I:
$livros = Livro::where('localizacao','LIKE','I%')->whereDoesntHave('instances')->get();
foreach($livros as $livro){
$livro->delete();
}