作者 lyh

gx

... ... @@ -11,12 +11,14 @@ namespace App\Models\ASide;
use App\Models\Base;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class APublicModel extends Base
{
const STATUS_ON = 1;
/**
* @remark :查询对应项目对应产品博客新闻数量
* @name :getNumByProjectId
... ... @@ -36,25 +38,5 @@ class APublicModel extends Base
return ['product'=>$productNumber,'blog'=>$blogNumber,'news'=>$newsNumber];
}
const STATUS_ON = 1;
public static function getProductNumByProjectId($project_id){
ProjectServer::useProject($project_id);
$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);
$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);
$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;
}
}
... ...