Category: Laravel
-
Post Views: 17 1. Verify the fields that conform to the MySQL field type Decimal(8,2) in Lavavel 9. as shown in Figure 1 2. The final realization is as follows 3. Try respectively: -4 (fail), 0 (success), 5 (success), 999999.99 (success), 999999.990 (success), 999999 .991 (failed), 9999990.99 (fail), 0.09 (success), 0.009 (fail), 0.0000001 (failed), in line with expectations. as shown…
-
Post Views: 16 1. Execute database migration in Laravel 9, modify the field name, and then modify its properties, and report an error: There is no column with name inbounded_quantity on table return_order_items. As shown in Figure 1 2. The code is implemented as follows 3. Decide to try to modify its properties first, and then modify the field name.…
-
Post Views: 17 1. Execute the database migration error in Laravel 9: sqlstate[HY000]: General error: 1366 Incorrect decimal value:0for columnat row -1. as shown in Figure 1 2. Copy the error-reported sql to Navicat for MySQL to execute, but still report the error: 1366 – Incorrect decimal value:0for columnat row -1. as shown in Figure 2 3. Check the code…
-
Post Views: 18 1. In Laravel 9, the queue task timeout. Decided to try to verify, the implementation in the task class is as follows. Finally found that it was not in effect on Windows systems. The reason is that the PCNTL PHP extension must be installed to specify the task timeout. But this extension is not available on the…
-
Post Views: 19 1. In Laravel 9, what is the default value of the maximum number of attempts for the queue task? Decided to try to verify, the implementation in the task class is as follows 2. The print log is as follows 3. The maximum number of attempts to define the task class itself is 1, and the implementation…
-
Post Views: 18 1. In a list page, when there are 2 sets of time fields, each group is 2, one is the beginning and the other is the end, and it is necessary to verify that there must be a set of time fields. as shown in Figure 1 2. A total of 4 fields are: shipping_at_gmt_start, shipping_at_gmt_end, operated_at_gmt_start,…
-
Post Views: 15 1. The request parameters are as follows, you need to ensure that the shipping_at_gmt_end cannot exceed the shipping_at_gmt_start for 3 months. as shown in Figure 1 2. Use closure to customize the verification rules, based on Carbon. After adding SHIPPING_AT_GMT_START for 3 months before comparing with SHIPPING_AT_GMT_END, if SHIPPING_AT_GMT_END is still later than Shipping_at_gmt_start adds the value…
-
Post Views: 21 1. In MySQL 8, the IN condition is used for multiple fields, and the query result is empty. as shown in Figure 1 2. Reference:In MySQL 8, the in condition is used for multiple fields The query result is not empty for sql as follows 3. Reference:Error when using native expression query in Laravel 9: SQLState[42000]: syntax…
-
Post Views: 17 1. Reference:In MySQL 8.0, when querying the total number of table records, the analysis optimization of the timeout. The execution time in Navicat is: 3.075 seconds. as shown in Figure 1 2. The execution time in Laravel 9 is: 60317.74ms. It is equivalent to 60 seconds. as shown in Figure 2 3. Verify another count(*) SQL, the…
-
Post Views: 17 1. Reference: In mysql 8.0, when the total number of table records is checked, the analysis and optimization of the timeout is optimized. Add WHERE ID > 0 when a COUNT SQL does not exist where condition exists. 2. Reference:How to check if table is already has a where Clause in Laravel Query Builder? The final implementation…