作者 lyh

gx

@@ -11,12 +11,14 @@ namespace App\Models\ASide; @@ -11,12 +11,14 @@ namespace App\Models\ASide;
11 11
12 use App\Models\Base; 12 use App\Models\Base;
13 use App\Services\ProjectServer; 13 use App\Services\ProjectServer;
14 -use Illuminate\Support\Facades\Cache;  
15 use Illuminate\Support\Facades\DB; 14 use Illuminate\Support\Facades\DB;
16 15
17 class APublicModel extends Base 16 class APublicModel extends Base
18 { 17 {
19 18
  19 +
  20 + const STATUS_ON = 1;
  21 +
20 /** 22 /**
21 * @remark :查询对应项目对应产品博客新闻数量 23 * @remark :查询对应项目对应产品博客新闻数量
22 * @name :getNumByProjectId 24 * @name :getNumByProjectId
@@ -36,25 +38,5 @@ class APublicModel extends Base @@ -36,25 +38,5 @@ class APublicModel extends Base
36 return ['product'=>$productNumber,'blog'=>$blogNumber,'news'=>$newsNumber]; 38 return ['product'=>$productNumber,'blog'=>$blogNumber,'news'=>$newsNumber];
37 } 39 }
38 40
39 - const STATUS_ON = 1;  
40 - public static function getProductNumByProjectId($project_id){  
41 - ProjectServer::useProject($project_id);  
42 - $number = DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();  
43 - DB::disconnect('custom_mysql');  
44 - return $number;  
45 - }  
46 -  
47 - public static function getBlogNumByProjectId($project_id){  
48 - ProjectServer::useProject($project_id);  
49 - $number = DB::connection('custom_mysql')->table('gl_blog')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();  
50 - DB::disconnect('custom_mysql');  
51 - return $number;  
52 - }  
53 41
54 - public static function getNewsNumByProjectId($project_id){  
55 - ProjectServer::useProject($project_id);  
56 - $number = DB::connection('custom_mysql')->table('gl_news')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();  
57 - DB::disconnect('custom_mysql');  
58 - return $number;  
59 - }  
60 } 42 }