From 7b473ffa5cc958284523c11e6aae916a225b962e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E7=A3=8A?= <751475802@qq.com>
Date: Thu, 30 Mar 2023 11:44:42 +0800
Subject: [PATCH] 1
---
application/master/controller/Article.php | 96 ++++++++++++++---------
1 file changed, 58 insertions(+), 38 deletions(-)
diff --git a/application/master/controller/Article.php b/application/master/controller/Article.php
index 020cf82..c8715ae 100644
--- a/application/master/controller/Article.php
+++ b/application/master/controller/Article.php
@@ -1329,6 +1329,21 @@ class Article extends Controller {
}
}
+
+ public function getArticleReportAuthors(){
+ $num = $this->request->post('num');
+ // $num = 1;
+ $size = 500;
+ $f = ($num-1)*$size;
+ $list = $this->article_obj->where('state',0)->limit($f,$size)->select();
+ foreach($list as $k => $v){
+ $author = $this->article_author_obj->where('article_id',$v['article_id'])->where('is_report',1)->where('state',0)->select();
+ $list[$k]['author'] = $author;
+ }
+ $re['list'] = $list;
+ return jsonSuccess($re);
+ }
+
/**
* @title 文章文件上传
* @description 文章文件上传
@@ -1629,52 +1644,52 @@ class Article extends Controller {
// die;
}
- public function cccc(){
- die;
- $data = $this->request->post();
- $rule = new Validate([
- 'num'=>'require'
- ]);
- if(!$rule->check($data)){
- return jsonError($rule->getError());
- }
+ // public function cccc(){
+ // die;
+ // $data = $this->request->post();
+ // $rule = new Validate([
+ // 'num'=>'require'
+ // ]);
+ // if(!$rule->check($data)){
+ // return jsonError($rule->getError());
+ // }
- $limit_start = ($data['num'] - 1) * 20;
- $list = $this->article_obj->where('doi','like',"10.12032%")->where('state',0)->limit($limit_start,20)->select();
- foreach($list as $v){
- $c = explode('/',$v['doi']);
+ // $limit_start = ($data['num'] - 1) * 20;
+ // $list = $this->article_obj->where('doi','like',"10.12032%")->where('state',0)->limit($limit_start,20)->select();
+ // foreach($list as $v){
+ // $c = explode('/',$v['doi']);
- $author = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->find();
- if ($author == null) {
- continue;
- }
- $article_info = $this->article_obj->where('article_id', $v['article_id'])->find();
- if ($article_info['npp'] == '') {
- continue;
- }
- $url = 'https://doi.crossref.org/servlet/deposit';
- $file = ROOT_PATH . 'public' . DS . 'xml' . DS . $v['article_id'] . '.xml';
+ // $author = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->find();
+ // if ($author == null) {
+ // continue;
+ // }
+ // $article_info = $this->article_obj->where('article_id', $v['article_id'])->find();
+ // if ($article_info['npp'] == '') {
+ // continue;
+ // }
+ // $url = 'https://doi.crossref.org/servlet/deposit';
+ // $file = ROOT_PATH . 'public' . DS . 'xml' . DS . $v['article_id'] . '.xml';
- $d['article_id'] = $v['article_id'];
- $d['doi_num'] = $c[1];
- $this->crossRef($d);
+ // $d['article_id'] = $v['article_id'];
+ // $d['doi_num'] = $c[1];
+ // $this->crossRef($d);
- //存储
- $this->article_obj->where('article_id', $v['article_id'])->update(['doi' => '10.53388/' . $c[1]]);
+ // //存储
+ // $this->article_obj->where('article_id', $v['article_id'])->update(['doi' => '10.53388/' . $c[1]]);
- //发送请求
- $par['login_id'] = 'books@tmrjournals.com/tmrp';
- $par['login_passwd'] = '849192806pnX';
- $par['fname'] = new \CURLFile($file);
+ // //发送请求
+ // $par['login_id'] = 'books@tmrjournals.com/tmrp';
+ // $par['login_passwd'] = '849192806pnX';
+ // $par['fname'] = new \CURLFile($file);
- $this->myPost($url, $par);
- // echo '10.53388/'.$c[1];
- // echo '
';
- }
+ // $this->myPost($url, $par);
+ // // echo '10.53388/'.$c[1];
+ // // echo '
';
+ // }
- // dump($list);
- }
+ // // dump($list);
+ // }
public function crossRef($data) {
$xml = '';
@@ -1743,6 +1758,11 @@ http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
$xml .= '' . PHP_EOL;
$xml .= '10.53388/' . trim($data['doi_num']) . '' . PHP_EOL;
$xml .= '' . PHP_EOL;
+ $xml .= ''.PHP_EOL;
+ $xml .= '- '.PHP_EOL;
+ $xml .= ''.PHP_EOL;
+ $xml .= '
'.PHP_EOL;
+ $xml .= ''.PHP_EOL;
$xml .= '' . PHP_EOL;
$xml .= '' . PHP_EOL;
$xml .= '' . PHP_EOL;