|
@@ -743,25 +743,27 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
//用户类型
|
|
|
$res['userType'] = [];
|
|
|
$res['website']['count'] = Website::where([])->count();
|
|
|
- $res['article']['count'] = Article::whereNotIn('status', ['404'])->count();
|
|
|
+ $res['article']['count'] = Article::whereIn('status', [1])->count();
|
|
|
$res['category']['count'] = Category::where([])->count();
|
|
|
- $res['good']['count'] = Good::where([])->count();
|
|
|
- $res['book']['count'] = Book::where([])->count();
|
|
|
- $res['jobHunting']['count'] = JobHunting::where([])->count();
|
|
|
- $res['jobRecruiting']['count'] = JobRecruiting::where([])->count();
|
|
|
- $res['complaint']['count'] = Complaint::where([])->count();
|
|
|
- $res['notice']['count'] = Notice::where([])->count();
|
|
|
+ $res['good']['count'] = Good::whereIn('status', [2])->count();
|
|
|
+ $res['book']['count'] = Book::whereIn('status', [2])->count();
|
|
|
+ $res['jobHunting']['count'] = JobHunting::whereIn('status', [2])->count();
|
|
|
+ $res['jobRecruiting']['count'] = JobRecruiting::whereIn('status', [1])->count();
|
|
|
+ $res['complaint']['count'] = Complaint::whereIn('status', [2])->count();
|
|
|
+ $res['notice']['count'] = Notice::whereIn('status', [2])->count();
|
|
|
|
|
|
// $res['monthArticle'] = Db::select('SELECT DATE(created_at) AS date,COUNT(*) AS total_count FROM article WHERE created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(created_at) ORDER BY date ASC;');
|
|
|
- $res['monthArticle'] = Db::select(' SELECT DATE(article.created_at) AS date,COUNT(*) AS count ,user.type_id FROM article left JOIN user on article.admin_user_id = user.id WHERE article.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(article.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
+ $res['monthArticle'] = Db::select(' SELECT DATE(article.created_at) AS date,COUNT(*) AS count ,user.type_id FROM article left JOIN user on article.admin_user_id = user.id WHERE
|
|
|
+ article.status =1 and article.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(article.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
|
|
|
- $res['monthGood'] = Db::select(' SELECT DATE(good.created_at) AS date,COUNT(*) AS count ,user.type_id FROM good left JOIN user on good.user_id = user.id WHERE good.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(good.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
+ $res['monthGood'] = Db::select(' SELECT DATE(good.created_at) AS date,COUNT(*) AS count ,user.type_id FROM good left JOIN user on good.user_id = user.id WHERE
|
|
|
+ good.status =2 and good.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(good.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
|
|
|
- $res['monthBook'] = Db::select(' SELECT DATE(book.created_at) AS date,COUNT(*) AS count ,user.type_id FROM book left JOIN user on book.user_id = user.id WHERE book.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(book.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
+ $res['monthBook'] = Db::select(' SELECT DATE(book.created_at) AS date,COUNT(*) AS count ,user.type_id FROM book left JOIN user on book.user_id = user.id WHERE book.status =2 and book.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(book.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
|
|
|
- $res['monthJobHunting'] = Db::select(' SELECT DATE(job_hunting.created_at) AS date,COUNT(*) AS count ,user.type_id FROM job_hunting left JOIN user on job_hunting.user_id = user.id WHERE job_hunting.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(job_hunting.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
+ $res['monthJobHunting'] = Db::select(' SELECT DATE(job_hunting.created_at) AS date,COUNT(*) AS count ,user.type_id FROM job_hunting left JOIN user on job_hunting.user_id = user.id WHERE job_hunting.status =2 and job_hunting.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(job_hunting.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
|
|
|
- $res['monthJobRecruiting'] = Db::select(' SELECT DATE(job_recruiting.created_at) AS date,COUNT(*) AS count ,user.type_id FROM job_recruiting left JOIN user on job_recruiting.user_id = user.id WHERE job_recruiting.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(job_recruiting.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
+ $res['monthJobRecruiting'] = Db::select(' SELECT DATE(job_recruiting.created_at) AS date,COUNT(*) AS count ,user.type_id FROM job_recruiting left JOIN user on job_recruiting.user_id = user.id WHERE job_recruiting.status =1 and job_recruiting.created_at >= CURDATE() - INTERVAL 30 DAY GROUP BY DATE(job_recruiting.created_at),`user`.type_id ORDER BY date ASC');
|
|
|
|
|
|
|
|
|
|
|
@@ -791,13 +793,15 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
->get();
|
|
|
|
|
|
$res['article'] = $article;
|
|
|
- $res['article']['count'] = Article::whereNotIn('status', ['404'])->where('admin_user_id', $user_id)->count();
|
|
|
- $res['good']['count'] = Good::where([])->where('user_id', $user_id)->count();
|
|
|
- $res['book']['count'] = Book::where([])->where('user_id', $user_id)->count();
|
|
|
- $res['jobHunting']['count'] = JobHunting::where([])->where('user_id', $user_id)->count();
|
|
|
- $res['jobRecruiting']['count'] = JobRecruiting::where([])->where('user_id', $user_id)->count();
|
|
|
- $res['complaint']['count'] = Complaint::where([])->where('user_id', $user_id)->count();
|
|
|
- $res['notice']['count'] = Notice::where([])->where('user_id', $user_id)->count();
|
|
|
+ $res['website']['count'] = Website::where([])->count();
|
|
|
+ $res['article']['count'] = Article::whereIn('status', [1])->count();
|
|
|
+ $res['category']['count'] = Category::where([])->count();
|
|
|
+ $res['good']['count'] = Good::whereIn('status', [2])->count();
|
|
|
+ $res['book']['count'] = Book::whereIn('status', [2])->count();
|
|
|
+ $res['jobHunting']['count'] = JobHunting::whereIn('status', [2])->count();
|
|
|
+ $res['jobRecruiting']['count'] = JobRecruiting::whereIn('status', [1])->count();
|
|
|
+ $res['complaint']['count'] = Complaint::whereIn('status', [2])->count();
|
|
|
+ $res['notice']['count'] = Notice::whereIn('status', [2])->count();
|
|
|
|
|
|
//待审核数据
|
|
|
$res['apply']['article'] = Article::where(['status' => 0])->where('admin_user_id', $user_id)->count(); //
|