Posts by Tiago Paza • 163 points
22 posts
-
1
votes0
answers36
viewsQ: Reduce array by key/value in javavascript
How can I reduce the array by grouping it by the key/value and the keys I receive are dynamic? Input: [ { "CORAS": "PP007" }, { "CORAS": "PP008" }, { "COREN": "PP007" }, { "COREN": "PP008" }, {…
-
0
votes1
answer851
viewsQ: Scan array via javascript and remove duplicate objects with Map
I’m going through the following JSON: [ { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ] }, { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ] }, { "amount": 6, "codes": [ "BRCH", "ARSI", "ENSI" ]…
-
0
votes1
answer45
viewsQ: Query SQL returns data that was not to be returned
Well, I’m putting together a ticket sales system for football matches as a project of my course I’m working with the Laravel + Eloquent ORM, but I’m having an inconsistency. My code is: $matches =…
-
0
votes1
answer86
viewsQ: Clear previous request and perform new only with the last element with jQuery
I’m having a question in jQuery that I developed, I’m populating the data in style "combobox" and the requests and answers are correct however, my problem is when I click again on my…
-
1
votes1
answer41
viewsQ: Redo array with maximum position limit
I’m working with Laravel and was looking at a bootstrap template to customize the application and came across this format to display the followers: My question is how could treat the array that…
-
0
votes1
answer35
viewsA: Doubt to level array after consulting SQL with Eloquent
I looked at Stackoverflow and Google and found the solution and put this answer to help if someone goes through something similar, well, I changed mine foreach $concat for: $products =…
-
1
votes1
answer35
viewsQ: Doubt to level array after consulting SQL with Eloquent
Hey, guys, I put together the following code: $concat = array(); $products_categories = array(); $departament = $request->getParsedBodyParam('departamento'); $categories =…
-
1
votes0
answers124
viewsQ: Record API response with Angular/Ionic
I’m having a question with the Angular/Ionic I’m using to build an app. I own the following: import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from…
-
0
votes0
answers49
viewsQ: Doubt about eloquent with Laravel
Eai guys, I’m setting up a management system of football clubs just to practice and in that came a question, I have the following eloquent: $matches = DB::table('ut_tickets AS TIC')…
-
2
votes2
answers290
viewsA: Doubt when performing SQL with Eloquent of Laravel
I’m very pissed but happy to have tidied up hahaha, thanks for the tips, but I solved it in a way so stupid that it still hasn’t come to light. $balances = BankUser::select(DB::raw('SUM(balance) AS…
-
3
votes2
answers290
viewsQ: Doubt when performing SQL with Eloquent of Laravel
I’m with a bug I don’t know why. I have in my controller the following Eloquent: $balances = BankUser::select(DB::raw('SUM(balance) AS total, created_at, DATE(created_at) AS total_at'))…
-
0
votes1
answer86
viewsQ: AJAX/jQuery call running only once
Good morning guys, I am setting up a tree scheme (network) where I send the parameters via GET to my API, and it returns me the data to mount my code is as follows: $('.btn-rede').click(function ()…
-
1
votes0
answers101
viewsQ: Problem running event with Mysql
Eai guys, all right? I’m having a doubt, I set up the following SQL CREATE DEFINER = `root`@`localhost` EVENT `ut_clear_cart` ON SCHEDULE EVERY 1 MINUTE STARTS '2018-11-20 00:00:00' ON COMPLETION…
-
0
votes1
answer85
viewsQ: Shopping Cart (checkout) keeping only the last value
all right? I’m working on a project with Laravel PHP framework for back-end and jQuery for front-end. I’m setting up a ticket checkout for football stadiums for a system I’m developing. I have…
-
0
votes2
answers272
viewsA: Dynamically popular JSON with PHP/Laravel
I do not know if it is the most correct way but I followed your idea and I put together the following structure: $users = User::select('name_first', 'name_second', 'id_user_parent')->get();…
-
1
votes2
answers272
viewsQ: Dynamically popular JSON with PHP/Laravel
I am working with Laravel in a project of a client where I intend to assemble a tree structure with registered users on the system, I found a script that performs this, and for this he uses Jsons to…
-
0
votes1
answer31
viewsA: Export array globally with Laravel framework
Solved! I didn’t have to touch my controller or model or view. Had not carried out the use of provideres and it was with it that I solved. In my predecessor app\Providers\AppServiceProvider I edited…
-
0
votes1
answer31
viewsQ: Export array globally with Laravel framework
Eai galera! I’m working with Laravel on a project, and I came up with a question even being (idiot). I have structured all my controllers, models and views, but I have a view called: base.blade.php…
-
0
votes1
answer98
viewsQ: Access data within PHP array
Hey, guys, all right? I have a problem with a project I’m working on. I receive a form where the user informs the data but in this form, it is possible that he click a button to insert new inputs…
-
0
votes0
answers61
viewsQ: SQL with SELECT and SUBSELECT to mount a chat
Hello guys from Stackoverflow, I’m mounting the SQL below to mount a chat service user, which brings the list of all active conversations, but I’m having a problem, my SQL is bringing the latest…
-
2
votes2
answers6988
viewsQ: Query with SELECT and SUB SELECT in Mysql
I have a question about SQL, never worked with sub selects and ended up getting lost with it. My SQL: SELECT CLI.id, CLI.nome, CLI.senha, CLI.email, CLI.cpf, CLI.celular, CLI.data_nasc, CLI.genero,…
-
0
votes1
answer284
viewsQ: Transform Brute Inner Join to Laravel Join
I’m updating a system that is developed in pure PHP and I’m putting it in Laravel, however, I’ve never made more than a Join and with "AND" parameters so I would like you to help me, how can I put…