Year: 2023
-
Post Views: 16 1. In Laravel 6, execute the UpdateOrCreate method to update the existing model or create a new model if it does not exist. The last generated sql is as follows, the field checksum is missing. as shown in Figure 1 2. The code is implemented as follows: 3. Print the variable $extra, and determine that the field…
-
Post Views: 19 1. Adding fields to a table takes 180 seconds. as shown in Figure 1 2. The total number of records in the query table is: 173816. as shown in Figure 2 3. Decide to allow the newly added field to be null, and add the field again, which takes 104 seconds. as shown in Figure 3 4.…
-
Post Views: 57 1. In the ATM machine of the bank, when withdrawing cash, you can only withdraw 5,000 yuan at a time, and you can only withdraw 20,000 yuan a day, which has long been clear. However, when I deposited cash, I put in 20,000 yuan at a time, and the machine prompted that it could not be recognized.…
-
Post Views: 19 1. In PHP 7.4, when using file_put_contents, an error is reported: Failed to open stream: no such file or directory. as shown in Figure 1 2. The reason is the file name: theme-cdn-config-2023-02-23-10:23:19.txt format is incorrect, it contains :, replace : with -, run again, no errors are reported.
-
Post Views: 20 1. In the container, when the environment variable is obtained for the first time, the configuration value of the production environment is obtained, or it is not obtained (set in the program, when the environment variable is not set, the default setting is the configuration value of the production environment). When the environment variable is obtained for…
-
Post Views: 65 1. When executing: npm install, it has been executed for about half an hour, and an error is reported: if you are behind a proxy, please make sure that theProxyconfig is set properly. . as shown in Figure 1 2. Check the npm proxy settings, the value is: https://127.0.0.1:8888/ 3. Decide to delete the npm proxy settings.…
-
Post Views: 15 1. There was an implementation before, which is to judge a specific record, whether it meets a certain complex nesting condition, and the code is implemented as follows 2. Now you need to query all records that meet this complex nesting condition, refer to:https://learnku.com/docs/laravel/6.x/queries/5171#2f5914, the code is implemented as follows 3. The final generated SQL is in…
-
Post Views: 15 1. Reference: In Refactoring: Improve the Design of Existing Code (2nd Edition), run test cases based on Mocha. 2. MOCHA allows you to use any of the assertion libraries you want. In the above example, we used Node.js’s built-in assertion module. Schedule to use assertion library Chai. 3. Reference:https://mochajs.org/#assertions. The assertion library Chai supports expect(), assert() and…