|
...
|
...
|
@@ -18,17 +18,22 @@ class APublicModel extends Base |
|
|
|
const STATUS_ON = 1;
|
|
|
|
public static function getProductNumByProjectId($project_id){
|
|
|
|
ProjectServer::useProject($project_id);
|
|
|
|
var_dump(config('database.connections.custom_mysql'));
|
|
|
|
return DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
$number = DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $number;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getBlogNumByProjectId($project_id){
|
|
|
|
ProjectServer::useProject($project_id);
|
|
|
|
return DB::connection('custom_mysql')->table('gl_blog')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
$number = DB::connection('custom_mysql')->table('gl_blog')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $number;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getNewsNumByProjectId($project_id){
|
|
|
|
ProjectServer::useProject($project_id);
|
|
|
|
return DB::connection('custom_mysql')->table('gl_news')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
$number = DB::connection('custom_mysql')->table('gl_news')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $number;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|