Year: 2024
-
Post Views: 16 1. The current request parameter structure is as follows. Prepare to verify config[‘appoint_country’][‘appoint_country’][‘value’][0], config[‘appoint_country’][‘appoint_country’][‘value’][1]. as shown in Figure 1 2. The verification code is implemented as follows. Try to verify that the maximum length of the value in the index array is 1. Validation failed, as expected. as shown in Figure 2 3. Specify a custom message…
-
Post Views: 16 1. The current collection format is as follows 2. If you need to look up based on id, the firstwhere method returns the first element in the collection with a given key/value pair 3. Now you need to look up based on the two key-value pairs of name and email. The first method returns the first element…
-
Post Views: 22 1. Reference: In MySQL 8, the IN condition is used for multiple fields. 2. When you need to use the native expression query in Laravel 9, the in condition is used for multiple fields. WhereRaw and OrwhereRaw methods inject the native “Where” into your query. 3. Execute error: sqlstate[42000]: Syntax error or access Violation: 1064 you have…
-
Post Views: 15 1. There is no primary key ID of the A table in the B table, but there are 2 other fields of the A table. Now plan to query the records in the A table based on the other 2 fields of the A table. Plan to use in conditions. The general standard usage is shown below…
-
Post Views: 19 1. In Laravel 9, a list of APIs has now been implemented, which is based on Spatie\QueryBuilder\QueryBuilder to easily build Eloquent queries from API requests. However, now you need to implement a function of exporting Excel on the list page, planned to be implemented in asynchronous queues. So, if you want to reuse the code that built…
-
Post Views: 63 1. Error: class “vtifulkernelexcel” not found. 2. The reason is that the extension php-ext-xlswriter is not installed. 3. GitHub Release: https://github.com/viest/php-ext-xlswriter/releases download php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip. as shown in Figure 1 4. After decompression, copy php_xlswriter.dll to C:php-8.1.27extphp_xlswriter.dll 5. Edit php.ini, add extension=xlswriter 6. After restarting php, the error is reported again:[ERROR]workbook_close(): error creatingE:WWWRootObjectStorageAppExport/Order/Order Export Task 2024-02-19 10:24:06.xls. error =…
-
Post Views: 15 1. In Laravel 9, after executing redis::set($this->rules_update_key, carbon::now()); and found that the written value is Object. as shown in Figure 1 2. But in the test environment, the written value is a datetime string. Its value: 2024-01-30 06:00:00. as shown in Figure 2 3. The final comparison found that the root of the difference is that in…
-
Post Views: 18 1. In PHP, insert the JSON string (the Chinese has been encoded) into MySQL, and the Chinese has been encoded. as shown in Figure 1 2. Try to url decode the entire JSON string directly. Instead of converting JSON to an array, then traversing the array, url decoding each value, and finally encode the array into a…
-
Post Views: 16 1. Set the default value of DateTime in MySQL 8.0 to be0000-00-00 00:00:00Time error: sqlstate[42000]: Syntax error or access Violation: 1067 Invalid default value forOPERATED_AT_GMT. as shown in Figure 1 2. Reference:https://www.shuijingwanwq.com/2022/09/28/6993/In Navicat for MySQL, when the table is copied from one database to another, an error is reported:[ERR]1292 – Incorrect DateTime Value: ‘0000-00-00 00:00:00’ for column…
-
Post Views: 18 1. After downloading the installation package of MySQL 8.0, start the installation. The process prompts: Select products to upgrade. using this wizard you will be able to update your installed products. upgradeable products. MySQL Server can be upgraded from 5.7.19 to 5.7.44. Can’t upgrade to 8.0. as shown in Figure 1 2. Decide to back up the…