Category: Yii 2
-
Post Views: 16 1. The operation of the command-line script is supported based on Supervisor. During the continuous operation, the problem of occupying too much memory is still not fundamentally solved. Check the URL:https://www.shuijingwanwq.com/2019/07/24/3376/ 2. Check the URL:https://stackoverflow.com/questions/27341846/using-supervisor-as-cron, by calling the bash sleep command to execute the command-line script at a certain time interval to avoid continuous uninterrupted operation, so…
-
Post Views: 44 1. Since the log message is stored in the log table of mysql, in the production environment, a large amount of data has been accumulated, and the data length of the log table has reached hundreds of gigabytes. Therefore, it is decided to implement the timing deletion of log messages based on the console command line, and…
-
Post Views: 15 1. The interface for uploading the file, which only realizes the scenario of uploading the topic selection material, now needs to add the scene of the upload base icon, and decide to reuse the interface of the upload file, as shown in Figure 1 2. New request parameters, Scenario: optional, scene, default: default; CONFIG_BASE_LOCATION_ICON: The icon set…
-
Post Views: 14 1. will /build/c_files/etc/supervisord.d/yii-cmc-console-user-sync.ini, /build/c_files/etc/supervisord.d/yii-config-column-user-sync.ini Shear to /build/c_files/tmp/yii-cmc-console-user-sync.ini, /b uild/c_files/tmp/yii-config-column-user-sync.ini, as shown in Figure 1 2. Edit \build\c_files\config\init\console_init.sh, the code is as follows, as shown in Figure 2 3. Edit \build\readme.md, whether the console command is executed (when a single-machine deployment, it needs to be set to true; when deploying a cluster, only one machine needs to be…
-
Post Views: 15 1. Open the URL in Postman:http://api.pcs.wjdev.chinamcloud.cn/v1/assets/upload,Upload the file, the response failed, as shown in Figure 1 2. Check /runtime/logs/app.log, and report an error:[warning][yii\validators\FileValidator::validateValue]Missing the temperature folder to store the uploaded file: 360wallpaper(0).jpg 3. Go back to the previous version, no errors are reported, check the git log, and analyze the differences, as shown in Figure 2 4.…
-
Post Views: 15 1. View the task list page of Zen Tao, and its sorting is based on the descending order of ID, as shown in Figure 1 2. After clicking on the consumption field, the triangle is displayed as dark, indicating that the current sorting is based on the consumption ascending order, and if its value is the same,…
-
Post Views: 14 1. Open the URL in Postman:http://api.pcs-api.localhost/v1/plans/have?login_id=2e368664c41b8bf511bcc9c65d86dbc3&login_tid=f347ba5bb18cb3fbef94c0b37c796bf5&filter[and][0][or][0][title][like]=Shenzhen &Filter[status][neq]=0&filter[and][0][or][1][keyword]= keyword, as shown in Figure 1 2. Print request parameter: $requestParams 3. Print the filter: $filter 4. The final generated SQL is as follows, as shown in Figure 2 5. The current requirement is that the field keyword, keywords, multiple uses, and numbers are separated, and accurate matching is required,…
-
Post Views: 15 1. In the console command of Yii 2.0, an error is reported: yii\db\exception: redis error: err Invalid DB index Redis command was: Select 29 in /vendor/yiisoft/yii2-redis/src/connection.php:736, view /console/runtime/logs/app.log 2. The analysis found that when executing the command: Select 29, switch to the corresponding database: 29 errors, and a Redis instance has 16 databases by default, from 0…
-
Post Views: 50 1. Data validation failed in Yii 2.0: the source publishing user ID must be a string. as shown in Figure 1 2. The reason is the field: source_pub_user_id was int(11) in the table before, and later modified to varchar(64), in the model file regenerated based on GII, the verification rules are as follows 3. The interface has…