Posts by Daywison Ferreira Leal • 101 points
17 posts
-
-3
votes1
answer58
viewsQ: Build query in Laravel
`update `table` set is_available = 0 where id_restaurant = 303 (and weekday = ? or id = ? )` $weekday = $request->input('weekday', ''); $table = $request->input("id", ''); //Query em…
laravelasked Daywison Ferreira Leal 101 -
0
votes2
answers96
viewsQ: Remove array elements that are not in 2 PHP arrays
Array A [0] => stdClass Object ( [id] => 1542 [id_restaurant] => 303 [name] => Café da Manhã [hour] => 10:15:00 [quantity] => 10 [peoples] => 6 [weekday] => 1 [is_available]…
phpasked Daywison Ferreira Leal 101 -
0
votes1
answer34
viewsQ: Select with Join alternative MYSQL
Table - log_tables_restaurants id | id_restaurant | id_admin | id_user | action 1 | 10 | 2 | NULL | adicionou 2 mesas 2 | 11 | 3 | NULL | removeu 2 mesas 3 | 20 | NULL | 30 | adicionou 10 mesas I…
mysqlasked Daywison Ferreira Leal 101 -
1
votes1
answer167
viewsQ: How to write Query using Laravel
How to write this Query in Laravel? SELECT a.id, a.name, a.email, a.role, a.percentage, a.remaining_tax, a.min_peoples_per_table ,a.regions, GROUP_CONCAT( r.name SEPARATOR ", ") as regions_name FROM…
laravelasked Daywison Ferreira Leal 101 -
0
votes3
answers1758
viewsA: Display comma separated results with Mysql
select admin.name, GROUP_CONCAT(DISTINCT r.name SEPARATOR ", ") as regiao from regions r inner join administrator admin on r.id = admin.regions group by r.id, admin.name order by admin.id desc The…
-
1
votes3
answers1758
viewsQ: Display comma separated results with Mysql
administrador | regiao bruno | 2,3,4 pedro | 1 jose | 5,7 I have an administrator table and a region table, where 1 administrator can manage a region or several. I want to make a query that brings…
-
0
votes2
answers360
viewsQ: Convert the date format of an array to Laravel/PHP
How to convert Indice [date_start] to 2018-08-23 12:19 format with php or Laravel ? Array ( [id_restaurant] => 303 [date_start] => 23/08/2018 12:19 [date_end] => 27/08/2018 12:19 )…
-
0
votes2
answers1390
viewsQ: How to go through an array of objects accessing each element of the array with PHP
[items:protected] => Array ( [0] => stdClass Object ( [id] => 130627 [avatar] => [first_name] => Prii [last_name] => Camargo [email] =>…
phpasked Daywison Ferreira Leal 101 -
1
votes1
answer845
viewsQ: Error when exporting Excel using Maatwebsite / Laravel-Excel
The excel export works well up to 10000 records but above that it returns me the error: "127.0.0.1 is Currently Unable to Handle this request. HTTP ERROR 500" Someone’s had that problem before?…
-
0
votes3
answers636
viewsQ: Average all records in a table and update column in MYSQL
I need to do a Query that passes in all table records and updates the rate_general column (this column is the average of the rate_food + rate_service + rate_price + rate_environment / 4 ) notes of…
-
0
votes0
answers205
viewsQ: How to create a migrate and add a calculated column to an existing table in the database?
I have the ratings table that has the columns Nota1, nota2, nota3, nota4 created in the database and wanted to create a media column that already computes the media automatically, how to create that…
-
0
votes1
answer371
viewsQ: How to access the property in a PHP object
When I gave this command echo $user->cards appeared this: [{"id":10,"id_user":2,"id_card":"11222","created_at":null,"updated_at":null,"deleted_at":null}] How to access the deleted_at property of…
-
0
votes2
answers234
viewsQ: How to redesign a Datatable if a checkbox is checked?
I have this table using datatable, and I need to change the WHERE of the select that fills it if the checkbox "View all users" is checked. I created this function to know if the checkbox is marked,…
asked Daywison Ferreira Leal 101 -
0
votes1
answer525
viewsQ: How to change the datatable property of a created table
I want to change the property "serverside" for false if the condition is met, how to change this from a table created with Datatable? var tabela = $("#lista-dados").DataTable({ "processing": false,…
asked Daywison Ferreira Leal 101 -
3
votes1
answer137
viewsQ: Authenticate in another PHP/Laravel application
I am logged in this application PHP , in this application has a list of users as the image below: By clicking this button Log in I want to be redirected to a Dashboard that is in the same domain,…
-
0
votes2
answers60
viewsQ: Calculate total orders and total orders for the current month with Mysql
I have this order table, I need to count the total order of each user and the total order of each user in the current month | id | id_user | name | data_criacao | | 1 | 10 |Pedro | 2018-05-01 | | 2…
mysqlasked Daywison Ferreira Leal 101 -
1
votes1
answer692
viewsQ: Percentage calculation in mysql
I have a booking table that has ID, ORIGIN (site, app or null) I want to know the percentage of reservations made by app and website, select count(id) from booking where origin = 'app' / select…
mysqlasked Daywison Ferreira Leal 101