# laravel-test-project **Repository Path**: github-mouyong/laravel-test-project ## Basic Information - **Project Name**: laravel-test-project - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: feat-mouyong - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-18 - **Last Updated**: 2023-01-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # laravel-test-project 根据 [tesk.md](/tesk.md) 搭建的项目。 ## 配置说明 - .env ``` # 其他数据库相关配置自行修改 DB_PREFIX=yl_ ``` - 以下目录 laravel 需要具备可写权限 `chmod -R 777 storage bootstrap/cache` **注:不得采用 fillable。减少开发对数据库字段与模型不匹配的处理** - 在 crontab 中配置定时任务 `* * * * * cd /your/project/path && php artisan schedule:run >> /dev/null 2>&1` ## API ### 需求说明 - 写一个API接口,接受`page`参数(即为第几页数据),返回`customers`的`visit_count`大于10的JSON数据,结构如下: ```json { "code": 0, "msg": "success", "data": { "total": 0, "list": [] } } ``` - 每页10条数据,`code`与`msg`为固定值; - `total`为满足条件的记录总数(即`visit_count`大于10) - `list`为`customers`满足条件的第`page`页数据 ### 参数说明 `GET /api/customers/hot` |参数|类型|示例|说明| |---|---|---|---| |page|integer|1|当前页数| |visit_ount|integer|1|访问次数,可不传,默认 10,测试传 1能看到数据| ### 请求示例 `GET /api/customers/hot` ```js { "page": 1, "visit_count": 1, // 可不传,默认 10,测试传 1能看到数据 } ``` ### 响应示例 ```json { "code": 0, "msg": "success", "data": { "total": 0, "list": [] } } ``` ## 开发 - 开发地址:http://laravel-test-project.hecs.iwnweb.com - 代码仓库:https://gitee.com/github-mouyong/laravel-test-project - 查看 [文档](/tesk.md) ## 自定义 Artisan 命令 | 命令行名字 | 说明 | Cron | 代码调用 | | --- | --- | --- | --- | | `test:random-visit` | 每分钟随机访问 10 个用户 | 1 分钟运行一次 | 无 |