Category: Yii 2
-
Post Views: 44 1. In the local environment, post in postman , http://api.aims-api.localhost/v1/tasks?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the response is successful 2. In development environment, post in postman , http://wjdev2.chinamcloud.com:8659/v1/tasks?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the response failed, as shown in Figure 2 3. Edit the Dockerfile of the interface (RPC client), and delete the passthru in disable_functions 4. Edit the Dockerfile of the RPC server and…
-
Post Views: 29 1. The API can distinguish application/x-www-form-urlencoded and multipart/form-data input formats by default, and view \api\config\main.php, request Configuration of application components 2. POST request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/x-www-form-urlencoded, as shown in Figure 1 3. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, input format: multipart/form-data, as shown in Figure 2 4. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/json, data…
-
Post Views: 14 1. Dynamic configuration of database connection in Yii 2 Starter Kit, the configuration attribute comes from the multi-tenant system,https://www.shuijingwanwq.com/2018/01/18/2328/, multi-tenant physical isolation implementation 2. In the public cloud, the system should serve multiple tenants at the same time, and multiple tenants share a database. Therefore, it is necessary to realize the logical isolation of multi-tenancy, that is,…
-
Post Views: 32 1. Based on yii2tech\ar\SoftDelete\SoftDeleteBehavior, the soft deletion of ActiveRecord is realized, and the URL is opened:https://github.com/yiisoft/yii2/blob/master/docs/guide-zh-CN/concept-behaviors.md, as shown in Figure 1 2. Install the ActiveRecord extension of Yii2, use the self-update command to update the composer to the latest version, use the update command to obtain the latest version of the dependencies, and upgrade the composer.lock file,…
-
Post Views: 53 1. In the development environment, the execution of the database migration command fails: 1071 Specified key was too long; Max key length is 767 bytes, as shown in Figure 17 2. Run sql in the database in the development environment, and report an error: #1071 – specific key was too long; max key length is 767 bytes,…
-
Post Views: 17 1. Configure the client through the application component, \common\config\main-local.php 2. Set the format used for the request content to json through the setFormat() method, \common\logics\http\yqdsj_api\article.php 3. When using the REST API, since the request format is all JSON, in order to simplify the code, the format of the request object can be directly configured. by configuring[[\yii\httpclient\Client]] requestConfig…
-
Post Views: 53 1. Use updateAll() to update the value of prev_status to the value of status, and update the value of status to 4, the table structure is shown in Figure 1 2. Based on the query builder, the code is as follows 3. However, it does not meet the expectations. The values of prev_status are updated with 0,…