Year: 2018
-
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: 14 1. The upgrade fails in Rancher, and Rolling-Back (Expected State Running But Got Stopped) appears when rolling back, as shown in Figure 1 2. Click the link to view the log, as shown in Figure 2 3. Log: WebTV-PCS-1, prompt: pcs_api_cfg_db_host, unbound variables (it can be clear that the environment variables were bound before, the reason has…
-
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,…
-
Post Views: 12 1. Edit \api\config\urlmanager.php, define the route to support put close/{id} 2. Edit \API\Controllers\PlantaskController.php, and define the action to support the close method 3. Edit \API\RESTS\plan_task\action.php, copy public function findModel($id) to public function findModels($id) to support finding multiple models 4. All IDs must exist, otherwise the response will fail, as shown in Figure 1 5. Create a new…
-
Post Views: 17 1. The model class file in the /common/models directory is only allowed to be generated by the GII tool, which is a common model data layer, as shown in Figure 1 2. The model file in the /common/logics directory is related to business logic, which is inherited to /common/models The data layer is the common model logic…
-
Post Views: 51 1. In Windows 10, right-click the system -> New -> There is no new text document, and it was used by the family for a while, and it was lost, as shown in Figure 1 2. Reference website: https://answers.microsoft.com/zh-hans/windows/forum/windows_7-desktop/%e 7%B3%BB%E7%BB%9F%E5%8F%B3%E9%94%AE%E6%96 %B0/8BA81D6B-24BF-4655-AFC1-3D0651013087 3. Click Start, enter notepad in “Start Search”, and open notepad2, as shown in Figure 2…
-
Post Views: 16 1. \API\RESTS\PLAN_TASK\CreateAction.php, please refer to the URL for the specific implementation:https://github.com/yiisoft/yii2/blob/master/docs/guide-zh-CN/input-tabular-input.md, the code is as follows: 2. On Postman, the request parameters are shown in Figure 1 3. At the request of the front-end, add the form name, \api\rests\plan_task\createaction.php, the code is as follows 4. \common\logics\plantask.php, the code is as follows 5. On Postman, the request parameters…