# 新东方论坛 **Repository Path**: panliang/new_oriental_forum ## Basic Information - **Project Name**: 新东方论坛 - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-31 - **Last Updated**: 2021-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 新东方校园论坛 ## 环境要求 - mysql >= 5.7 - php >= 7.2 - php extension: fileinfo - php function: proc_open, putenv - composer ## 安装 - `git clone https://gitee.com/panliang/new_oriental_forum.git` - `cd new_oriental_forum` - 开发环境执行: `composer install`, 生产环境执行: `composer install --optimize-autoloader --no-dev` - 复制 `.env.example` 文件为 `.env` - `php artisan key:generate` - 赋予目录 `./storage` 目录 和 `./boostrap/cache` 目录 写入权限(777) - 修改配置文件 ``` # 项目地址 APP_URL=http://example.com # 数据库配置 DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=admin-iframe DB_USERNAME=homestead DB_PASSWORD=secret ``` - 运行数据库迁移, `php artisan migrate --seed` - 本地文件上传, `php artisan storage:link` 或者手动创建软连 `ln -s /项目目录/storage/app/public public/storage` ## sql ### 更新用户帖子数 ``` update `users` set `topic_count` = (select count(1) from `topics` where `topics`.`user_id` = `users`.`id` and `topics`.`deleted_at` is null and `topics`.`published` = 1); ``` ### 更新帖子评论数 ``` update `topics` set `topics`.`reply_count` = (select count(`replies`.`id`) from `replies` where `topics`.`id` = `replies`.`topic_id`) ``` ### 更新帖子最新回复时间 ``` update `topics` set `replied_at` = (select `replies`.`created_at` from `replies` where `replies`.`id` = `topics`.`id` order by `replies`.`created_at` desc limit 1) ```