接口调整

This commit is contained in:
chengxl
2025-11-17 12:31:00 +08:00
parent 3446410d2e
commit d43f02e13d

View File

@@ -972,8 +972,22 @@ class Article extends Base
$inset_data['author_act'] = 1;
$inset_data['state'] = 1;
$where['article_id'] = $data['articleId'];
//更新文章用户最新操作状态 chengxiaoling start 20251113
$inset_data['is_user_act'] = 1;
$inset_data['user_update_time'] = time();
//更新文章用户最新操作状态 chengxiaoling end 20251113
$up_res = $this->article_obj->where($where)->update($inset_data);
//更新文章用户最新操作状态 chengxiaoling start 20251113
$iArticleId = empty($data['articleId']) ? 0 : $data['articleId'];
if(!empty($iArticleId)){
//用户操作日志
$oUserActLog = new \app\common\UserActLog;
$aUserLog = ['article_id' => $iArticleId,'type' => 4,'act_id' => $iArticleId,'user_id' => empty($user_res['user_id'] )? 0 : $user_res['user_id'],'content' => 'Retired author resubmits manuscript'];
$aAddResult = $oUserActLog->addLog($aUserLog);
}
//更新文章用户最新操作状态 chengxiaoling end 20251113
$article_info = $this->article_obj->where($where)->find();
$journal_info = $this->journal_obj->where("journal_id", $article_info["journal_id"])->find();
@@ -1045,9 +1059,9 @@ class Article extends Base
$insert['user_id'] = $user_info['user_id'];
$insert['ad_content'] = trim($data['ad_content']);
$insert['ad_ctime'] = time();
$this->article_dialog_obj->insert($insert);
$iId = $this->article_dialog_obj->insertGetId($insert);
//留言红点提示并邮件
$this->messageTips($data['article_id'], $user_info['user_id']);
$this->messageTips($data['article_id'], $user_info['user_id'],$iId);
return jsonSuccess([]);
}
@@ -3814,11 +3828,11 @@ class Article extends Base
$maidata['tpassword'] = $journal_info['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
//增加用户操作log
$log_data['user_id'] = $user_res['user_id'];
$log_data['type'] = 0;
$log_data['content'] = $user_res['account'] . "(" . $user_res['realname'] . "),上传了一篇文章:" . $data['title'] . ",上传时间是:" . date('Y-m-d H:i:s', time());
$log_data['content'] = $user_res['account'] . "(" . $user_res['realname'] . "),上传了一篇文章:" . $article_info['title'] . ",上传时间是:" . date('Y-m-d H:i:s', time());
$log_data['ctime'] = time();
$res_log = $this->user_log_obj->insert($log_data);
@@ -3860,7 +3874,18 @@ class Article extends Base
$update_l['accept_sn'] = $sArticleSn;
}
//新增保存字段 chengxiaoling 20251031 end
//更新文章用户最新操作状态 chengxiaoling start 20251113
$update_l['is_user_act'] = 1;
$update_l['user_update_time'] = time();
$update_l['received_time'] = time();
$iArticleId = empty($data['article_id']) ? 0 : $data['article_id'];
if(!empty($iArticleId)){
//用户操作日志
$oUserActLog = new \app\common\UserActLog;
$aUserLog = ['article_id' => $iArticleId,'type' => 5,'act_id' => $iArticleId,'user_id' => empty($user_res['user_id']) ? 0 : $user_res['user_id'],'content' => 'Author submits new manuscript'];
$aAddResult = $oUserActLog->addLog($aUserLog);
}
//更新文章用户最新操作状态 chengxiaoling end 20251113
$this->article_obj->where('article_id', $data['article_id'])->update($update_l);
$this->ai_scor($data['article_id']);
@@ -4575,18 +4600,18 @@ class Article extends Base
$where['state'] = 0;
$list = $this->journal_obj->where($where)->select();
//获取期刊封面 chengxiaoling 20251027 start
if(!empty($list)){
$aParam = ['issn' => array_column($list, 'issn')];
$sUrl = 'http://journalapi.tmrjournals.com/public/index.php/';
$sUrl = $sUrl."api/Supplementary/getJournal";
$aResult = object_to_array(json_decode(myPost1($sUrl,$aParam),true));
$aResult = empty($aResult['data']) ? [] : array_column($aResult['data'], 'icon','issn');
foreach ($list as $key => $value) {
$list[$key]['journal_icon'] = empty($aResult[$value['issn']]) ? '' : $aResult[$value['issn']];
}
}
//获取期刊封面 chengxiaoling 20251027 end
// //获取期刊封面 chengxiaoling 20251027 start
// if(!empty($list)){
// $aParam = ['issn' => array_column($list, 'issn')];
// $sUrl = 'http://journalapi.tmrjournals.com/public/index.php/';
// $sUrl = $sUrl."api/Supplementary/getJournal";
// $aResult = object_to_array(json_decode(myPost1($sUrl,$aParam),true));
// $aResult = empty($aResult['data']) ? [] : array_column($aResult['data'], 'icon','issn');
// foreach ($list as $key => $value) {
// $list[$key]['journal_icon'] = empty($aResult[$value['issn']]) ? '' : $aResult[$value['issn']];
// }
// }
// //获取期刊封面 chengxiaoling 20251027 end
return json($list);
}
@@ -4907,7 +4932,7 @@ class Article extends Base
* @param $article_id
* @param $user_id
*/
private function messageTips($article_id, $user_id)
private function messageTips($article_id, $user_id,$iId = 0)
{
$article = $this->article_obj->field('t_article.user_id,t_article.editor_id,t_article.accept_sn,t_journal.journal_id,t_journal.title,t_journal.email,t_journal.epassword,t_journal.issn as journal_issn,t_journal.website as journal_website')
->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT')
@@ -4916,7 +4941,17 @@ class Article extends Base
// 判断提交留言人的身份
$res = $this->user_obj->where('user_id', $user_id)->find();
if ($res['type'] == 1) { // 作者 - 修改author_act,并发送给编辑发邮件
$this->article_obj->where('article_id', $article_id)->update(['author_act' => 1]);
// $this->article_obj->where('article_id', $article_id)->update(['author_act' => 1]);
//更新文章用户最新操作状态 chengxiaoling start 20251113
$aUpdate = ['is_user_act' => 1,'user_update_time' => time(),'author_act' => 1];
$this->article_obj->where('article_id', $article_id)->limit(1)->update($aUpdate);
if(!empty($article_id) && !empty($iId)){
$oUserActLog = new \app\common\UserActLog;
$aUserLog = ['article_id' => $article_id,'type' => 6,'act_id' => $iId,'user_id' => $user_id,'content' => 'Author\'s new message submission'];
$aAddResult = $oUserActLog->addLog($aUserLog);
}
//更新文章用户最新操作状态 chengxiaoling end 20251113
$journal_info = $this->journal_obj->where("journal_id", $article['journal_id'])->find();
$editor = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
// 发邮件