Category: Laravel 9
-
Post Views: 44 1. Reference:Optimization of List Interface Response Timeout . In Spatie\QueryBuilder , query SQL enforces index . achieve the following 2. The generated sql is as follows, in line with expectations. as shown in Figure 1
-
Post Views: 18 1. Report an error in Laravel 9: Indirect modification of overloaded property returnRorder::$order has no effect. as shown in Figure 1 2. The code is implemented as follows 2. The adjusted code is implemented as follows, no more errors are reported
-
Post Views: 16 1. The current scenario is as follows. In one table, there is a field of payment method. Now if it is necessary, the payment method will be summarized into another table regularly. In order to prevent the records before the query is repeated every time the timing is executed, it is necessary to record a last execution…
-
Post Views: 14 1. The existing implementation is as follows, is a nested preload, sql is as follows 2. Now you need to add constraints for items, and the final implementation is as follows 3. The generated SQL is as follows, which is in line with expectations. as shown in Figure 1
-
Post Views: 18 1. In spatie\QueryBuilder, an error is reported: call to undefined method spatie\QueryBuilder\\AllowedFilter::endsWithStrict(). as shown in Figure 1 2. Search in vendor/spatie/laravel-query-builder/src/allowedFilter.php: EndsWithStrict, confirm that the EndsWithStrict method does not exist. 3. Check composer.json , “spatie/laravel-query-builder”: “^5.2”, . Use composer to automatically update to the latest compatible version of the package, 5.2.0 => 5.7.0. as shown in Figure…
-
Post Views: 17 1. In Spatie\QueryBuilder , the request parameter contains “,” error: sqlstate[HY093]: Invalid parameter number: number of bound variables not match number of tokens (SQL: select count(*) as aggregate from `table` where `table`.`Shipping_type` = 2 and `Shipping_at_gmt` >= 2024-05-21 08:54:14 and `Shipping_at_gmt` <= 2024-08-21 08:54:14 and `table`.`Shipping_error_message in (AAA)). as shown in Figure 1 2. When the request…
-
Post Views: 14 1. In Laravel 9, an error is reported when querying a chunkById block: sqlstate[23000]: Integrity Constraint Violation: 1052 ColumnIDin where Clause is ambigous. as shown in Figure 1 2. The code is implemented as follows 3. After adding the column parameter of chunkbyid, an error is reported: The chunkbyid operation was borne the[orders.id]Column is not present in…
-
Post Views: 15 1. The initial response structure is as follows: as shown in Figure 1 2. Since paging is not required, the front end wants to remove the package data key of the outermost resources, and set the “data” wrapper to null. Modify the resource collection class as follows 3. The result is as expected, and the interface…
-
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…