Category: Web Application Development
-
Post Views: 32 1. In yii2, an update interface, if the records in the table have been deleted before executing save(), it will still return ture, whether this situation needs to be avoided. as shown in Figure 1 2. The code is implemented as follows 3. Decide not to adjust for the time being.
-
Post Views: 30 1. The existing implementation is as follows. After the verification of the field itself fails, the interface response will always be: the database operation fails, please contact the administrator, the user experience is not friendly. as shown in Figure 1 2. Hope to achieve the following, 1. Do not expose database exceptions (such as SQL errors, PDO…
-
Post Views: 34 1. The existing implementation is as follows 2. The generated SQL is as follows 3. However, only1827082629732850,1827082629732857The corresponding type=5, and the other ID’s type != 5. as shown in Figure 1 4. Collect all values of type=5 (that is, image ID), query the corresponding pictures in batches, and attach image data. Re-implement as follows 5. The generated…
-
Post Views: 30 1. Now the portal link to switch the role to Distributor is the background homepage:https://console.apply.local/?role=distributor 2. I hope that in this portal URL, all links are automatically added to the request parameter: role=distributor, which is not available now. as shown in Figure 1 3. Create a custom URLManager component Rewrite the CreateUrl method, and automatically attach the…
-
Post Views: 22 1. Execute the migration command: yii migrate –migrationpath=@yii/rbac/migrations, the field length of the string type is 64 2. Create a new migration in this plan, and then modify the length of the field. However, when executing the migration command, an error SQLState is reported[HY000]: General Error: 1833 Cannot Change Columnname: Used in a foreign key constraintauth_item_child_ibfk_1of table.…
-
Post Views: 17 1. In yii2, when the server is abnormal, it does not respond to 500, but prompts in the browser: CORS error, which leads to user experience, the front end has been loaded all the time. The prompts in the console are as follows, as shown in Figure 1 2. The existing logic is in the browser, the…