request->param(); if ($params['channel_id']) { // 获取当前期刊下所有手稿数量 $manuscript_count = AuthorManuscript::where(['journal' => $params['channel_id']])->count(); // 获取录用状态下的期刊数量 $correct_manuscript_status = config('site.correct_manuscript_status'); $correct_manuscript_count = 0; foreach ($correct_manuscript_status as $correct_status) { $correct_manuscript_count += AuthorManuscript::where(['journal' => $params['channel_id'], 'status' => $correct_status])->count(); } } if ($correct_manuscript_count > 0) { $channel_rate = $correct_manuscript_count / $manuscript_count * 100; } $this->success('', round($channel_rate, 2) ?? 0); } public function getChannelDiyname() { $params = $this->request->param(); if ($params['channel_id']) { $channel = Channel::where(['id' => $params['channel_id']])->find(); } $this->success('', $channel); } /** * 根据时间获取对应会议列表 * * @return void * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function getConference() { $params = $this->request->param(); $year = $params['year']; $month = $params['month']; if (empty($year)) { $year = date('Y', time()); } if (empty($month)) { $month = date('m', time()); } $start_time = $year . '-' . $month; $end_time = date('Y-m-d', strtotime("$start_time +1 month -1 day")); $conferences = Conference::whereTime('createtime', 'between', [$start_time, $end_time])->select(); $this->success('', $conferences); } /** * 获取对应期刊文章信息 * * @return void */ public function getArticle() { $channel_id = $this->request->get('channel_id'); $archives = Archives::where(['p_channel_id' => $channel_id, 'channel_id' => 34])->order('weigh', 'DESC')->limit(4)->select(); $this->success('', $archives); } }