正在显示
1 个修改的文件
包含
9 行增加
和
4 行删除
| @@ -18,17 +18,22 @@ class APublicModel extends Base | @@ -18,17 +18,22 @@ class APublicModel extends Base | ||
| 18 | const STATUS_ON = 1; | 18 | const STATUS_ON = 1; |
| 19 | public static function getProductNumByProjectId($project_id){ | 19 | public static function getProductNumByProjectId($project_id){ |
| 20 | ProjectServer::useProject($project_id); | 20 | ProjectServer::useProject($project_id); |
| 21 | - var_dump(config('database.connections.custom_mysql')); | ||
| 22 | - return DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); | 21 | + $number = DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); |
| 22 | + DB::disconnect('custom_mysql'); | ||
| 23 | + return $number; | ||
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | public static function getBlogNumByProjectId($project_id){ | 26 | public static function getBlogNumByProjectId($project_id){ |
| 26 | ProjectServer::useProject($project_id); | 27 | ProjectServer::useProject($project_id); |
| 27 | - return DB::connection('custom_mysql')->table('gl_blog')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); | 28 | + $number = DB::connection('custom_mysql')->table('gl_blog')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); |
| 29 | + DB::disconnect('custom_mysql'); | ||
| 30 | + return $number; | ||
| 28 | } | 31 | } |
| 29 | 32 | ||
| 30 | public static function getNewsNumByProjectId($project_id){ | 33 | public static function getNewsNumByProjectId($project_id){ |
| 31 | ProjectServer::useProject($project_id); | 34 | ProjectServer::useProject($project_id); |
| 32 | - return DB::connection('custom_mysql')->table('gl_news')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); | 35 | + $number = DB::connection('custom_mysql')->table('gl_news')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count(); |
| 36 | + DB::disconnect('custom_mysql'); | ||
| 37 | + return $number; | ||
| 33 | } | 38 | } |
| 34 | } | 39 | } |
-
请 注册 或 登录 后发表评论