合并
This commit is contained in:
@@ -217,6 +217,24 @@ class Finalreview extends Base
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($aLists as $key => $value) {
|
||||
$rr = Db::name("article_reviewer_final")->where("reviewer_id",$value['user_id'])->order("id desc")->limit(1)->select();
|
||||
if(isset($rr[0])){
|
||||
$aLists[$key]['last_time'] = $rr[0]['invited_time'];
|
||||
}else{
|
||||
$aLists[$key]['last_time'] = 0;
|
||||
}
|
||||
$info = Db::name("user_reviewer_info")->field("field,field_ai")->where("reviewer_id",$value['user_id'])->find();
|
||||
if($info){
|
||||
$aLists[$key]['field'] = $info['field'];
|
||||
$aLists[$key]['field_ai'] = $info['field_ai'];
|
||||
}else{
|
||||
$aLists[$key]['field'] = '';
|
||||
$aLists[$key]['field_ai'] = '';
|
||||
}
|
||||
}
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => ['total' => $iCount,'lists' => $aLists]]);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,193 @@ class Order extends base{
|
||||
}
|
||||
}
|
||||
|
||||
/**提交改价申请
|
||||
* @return void
|
||||
*/
|
||||
public function applyPrice(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require",
|
||||
"fee"=>"require",
|
||||
"remark"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
// 查询文章、期刊和编辑者信息
|
||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||
$editor_info = $this->user_obj->where("user_id",$journal_info['editor_id'])->find();
|
||||
|
||||
// 验证编辑者权限
|
||||
if($journal_info['editor_id']!=$editor_info['user_id']){
|
||||
return jsonError("You are not the editor of this journal");
|
||||
}
|
||||
|
||||
$check = Db::name("article_price_apply")->where("article_id",$data['article_id'])->where("state",0)->find();
|
||||
if($check){
|
||||
return jsonError("There is an unfinished price change application for this article");
|
||||
}
|
||||
|
||||
$insert['article_id'] = $data['article_id'];
|
||||
$insert['old_fee'] = $article_info['fee'];
|
||||
$insert['fee'] = $data['fee'];
|
||||
$insert['remark'] = $data['remark'];
|
||||
$insert['ctime'] = time();
|
||||
Db::name("article_price_apply")->insert($insert);
|
||||
|
||||
|
||||
//发送邮件
|
||||
$tt = '您有新的价格审批!<a href="https://submission.tmrjournals.com/journalFeeApproval">link</a>';
|
||||
|
||||
sendEmail("18812616272@qq.com", "tmr-文章价格申请", "tmr-文章价格申请", $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return jsonSuccess();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getApplyList(){
|
||||
$data = $this->request->post();
|
||||
$data['pageIndex'] = isset($data['pageIndex'])?$data['pageIndex']:0;
|
||||
$data['pageSize'] = isset($data['pageSize'])?$data['pageSize']:10;
|
||||
$start_page = ($data['pageIndex']-1)*$data['pageSize'];
|
||||
$list = Db::name("article_price_apply")->where("state", $data['state'] ?? 0)->limit($start_page,$data['pageSize'])->select();
|
||||
foreach ($list as $k=>$v){
|
||||
$list[$k]['article_info'] = $this->article_obj->field("article_id,journal_id,accept_sn,title")->where("article_id",$v['article_id'])->find();
|
||||
$list[$k]['journal_info'] = $this->journal_obj->field("journal_id,title")->where("journal_id",$list[$k]['article_info']['journal_id'])->find();
|
||||
$list[$k]['history'] = Db::name("article_price_apply")->where("article_id",$list[$k]['article_info']['article_id'])->select();
|
||||
}
|
||||
$re['list'] = $list;
|
||||
$re['total'] = Db::name("article_price_apply")->where("state", $data['state'] ?? 0)->count();
|
||||
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
public function getApplyArticleList(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"state"=>"require",
|
||||
"pageIndex"=>"require",
|
||||
"pageSize"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$start_page = ($data['pageIndex']-1)*$data['pageSize'];
|
||||
$sql = "SELECT a.article_id,a.title,a.accept_sn,j.title journal_title FROM t_article a
|
||||
INNER JOIN (
|
||||
SELECT MAX(id) AS max_id, article_id
|
||||
FROM t_article_price_apply
|
||||
GROUP BY article_id
|
||||
) t ON a.article_id = t.article_id
|
||||
INNER JOIN t_article_price_apply apa ON apa.id = t.max_id
|
||||
LEFT JOIN t_journal j ON a.journal_id = j.journal_id
|
||||
WHERE apa.state = ".$data['state']."
|
||||
LIMIT ".$start_page.",".$data['pageSize'];
|
||||
|
||||
$row = Db::query($sql);
|
||||
|
||||
foreach ($row as $k=>$v){
|
||||
$row[$k]['history'] = Db::name("article_price_apply")->where("article_id",$v['article_id'])->select();
|
||||
}
|
||||
|
||||
|
||||
$countSql = "SELECT COUNT(*) AS total FROM t_article a
|
||||
INNER JOIN (
|
||||
SELECT MAX(id) AS max_id, article_id
|
||||
FROM t_article_price_apply
|
||||
GROUP BY article_id
|
||||
) t ON a.article_id = t.article_id
|
||||
INNER JOIN t_article_price_apply apa ON apa.id = t.max_id
|
||||
WHERE apa.state = ".$data['state'];
|
||||
$total = Db::query($countSql);
|
||||
$total = intval($total[0]['total'] ?? 0);
|
||||
$re['list'] = $row;
|
||||
$re['count'] = $total;
|
||||
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getApplyCount(){
|
||||
$res = Db::name("article_price_apply")->field("state,count(*) as count")->group("state")->select();
|
||||
|
||||
return jsonSuccess($res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function acceptPriceApply(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$apply_info = Db::name("article_price_apply")->where("id",$data['id'])->find();
|
||||
$article_update['fee']=$apply_info['fee'];
|
||||
$article_update['fee_remark']=$apply_info['remark'];
|
||||
|
||||
if(intval($apply_info['fee'])==0) {
|
||||
$article_update['is_buy']=1;
|
||||
}
|
||||
$this->article_obj->where("article_id",$apply_info['article_id'])->update($article_update);
|
||||
|
||||
Db::name("article_price_apply")->where("id",$data['id'])->update(['state'=>1]);
|
||||
|
||||
$order_info = $this->order_obj->where("article_id",$apply_info['article_id'])->whereIn("state",[0,1])->find();
|
||||
if($order_info){
|
||||
if(intval($apply_info['fee'])==0){
|
||||
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>2]);
|
||||
}else{
|
||||
$update1['order_fee']=$apply_info['fee'];
|
||||
$this->order_obj->where("order_id",$order_info['order_id'])->update($update1);
|
||||
}
|
||||
}
|
||||
|
||||
return jsonSuccess();
|
||||
}
|
||||
|
||||
public function getArticlePriceApplyList(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$list = Db::name("article_price_apply")->where("article_id",$data['article_id'])->select();
|
||||
|
||||
return jsonSuccess($list);
|
||||
}
|
||||
|
||||
|
||||
public function rejectPriceApply(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"id"=>"require",
|
||||
"remark"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
// $apply_info = Db::name("article_price_apply")->where("id",$data['id'])->find();
|
||||
Db::name("article_price_apply")->where("id",$data['id'])->update(['state'=>2,"remark"=>trim($data['remark'])]);
|
||||
return jsonSuccess();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改文章价格
|
||||
*
|
||||
|
||||
@@ -11,6 +11,7 @@ use think\Queue;
|
||||
use think\Validate;
|
||||
use think\log;
|
||||
use app\common\ArticleSymbolNormalizer;
|
||||
use app\common\ReferenceDispatchService;
|
||||
|
||||
/**
|
||||
* @title 公共管理相关
|
||||
@@ -1931,7 +1932,7 @@ class Production extends Base
|
||||
}
|
||||
|
||||
$this->referToDoi($data['p_article_id']);
|
||||
$this->doiTofrag($data['p_article_id']);
|
||||
(new ReferenceDispatchService())->dispatchRefersByType($data['p_article_id']);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -1998,19 +1999,7 @@ class Production extends Base
|
||||
|
||||
public function doiTofrag($p_article_id)
|
||||
{
|
||||
$p_info = $this->production_article_obj->where('p_article_id', $p_article_id)->find();
|
||||
$refers = $this->production_article_refer_obj->where('p_article_id', $p_info['p_article_id'])->where('state', 0)->select();
|
||||
foreach ($refers as $v) {
|
||||
if ($v['refer_doi'] == '') {
|
||||
$this->production_article_refer_obj->where('p_refer_id', $v['p_refer_id'])->update(['refer_frag' => $v['refer_content']]);
|
||||
} else {
|
||||
|
||||
//修改队列兼容对接OPENAI接口 chengxiaoling 20251128 start
|
||||
// Queue::push('app\api\job\ts@fire1', $v, 'ts');
|
||||
Queue::push('app\api\job\ArticleReferDetailQueue@fire', $v, 'ArticleReferDetailQueue');
|
||||
//修改队列兼容对接OPENAI接口 chengxiaoling 20251128 end
|
||||
}
|
||||
}
|
||||
(new ReferenceDispatchService())->dispatchRefersByType($p_article_id);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,10 @@ class Ucenter extends Base{
|
||||
if($check){
|
||||
return jsonError("Your application for Editorial Board is processing. Please do not repeat it.");
|
||||
}
|
||||
|
||||
$check_has = $this->user_to_yboard_obj->where('user_id',$data['user_id'])->where('state',0)->find();
|
||||
if ($check_has){
|
||||
return jsonError("You have already applied for Editorial Board.");
|
||||
}
|
||||
//判断是否上传CV
|
||||
$aWhere = ['user_id' => $data['user_id'],'state' => 0];
|
||||
$aCv = $this->user_cv_obj->field('user_cv_id')->where($aWhere)->find();
|
||||
|
||||
Reference in New Issue
Block a user