创建版本

This commit is contained in:
2021-02-22 12:17:00 +08:00
commit af555f49c3
2332 changed files with 369202 additions and 0 deletions
@@ -0,0 +1,24 @@
<?php namespace Gdoo\Article\Services;
use DB;
class ArticleService
{
/**
* 获取未读公告
*/
public static function getBadge()
{
$rows = DB::table('article')
->permission('receive_id')
->whereNotExists(function ($q) {
$q->selectRaw('1')
->from('article_reader')
->whereRaw('article_reader.article_id = article.id')
->where('article_reader.created_id', auth()->id());
})->get();
$ret['total'] = sizeof($rows);
$ret['data'] = $rows;
return $ret;
}
}