From fb647bd6fad10de3e71f41c35be09df95108d3c7 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Thu, 6 Feb 2025 11:24:08 +0800 Subject: [PATCH] 1 --- application/api/controller/Monitor.php | 30 +++++++++++----------- application/api/controller/Preaccept.php | 3 ++- application/common.php | 32 ++++++++++++++++++++++++ vendor/composer/installed.json | 18 ++++++------- vendor/composer/installed.php | 10 ++++---- 5 files changed, 63 insertions(+), 30 deletions(-) diff --git a/application/api/controller/Monitor.php b/application/api/controller/Monitor.php index 991dc02..173fb0c 100644 --- a/application/api/controller/Monitor.php +++ b/application/api/controller/Monitor.php @@ -76,7 +76,7 @@ class Monitor extends Base while ($year<=date("Y")){ $s_time = strtotime($year."-1-1"); $e_time = strtotime($year."-12-31"); - $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->count(); $frag[$year] = $n; $year++; } @@ -107,7 +107,7 @@ class Monitor extends Base while ($year<=date("Y")){ $s_time = strtotime($year."-1-1"); $e_time = strtotime($year."-12-31"); - $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where($j_sql)->count(); $frag[$year] = $n; $year++; } @@ -134,8 +134,8 @@ class Monitor extends Base if($abbr=="PD"&&$year<2024){ $abbr = "PR"; } - $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count(); - $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count(); + $nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count(); // $frag[$year."-".$month] = $n."/".$nj; // $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("journal_id",$v['journal_id'])->count(); $frag[$year] = $n."/".$nj; @@ -173,8 +173,8 @@ class Monitor extends Base if($abbr=="PD"&&$year<2024){ $abbr = "PR"; } - $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count(); - $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count(); + $nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count(); $frag[$year] = $n."/".$nj; $year++; } @@ -230,8 +230,8 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); - $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); + $n = $this->article_obj->where("state",">",-1)->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); + $nj = $this->article_obj->where("state",">",-1)->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); $frag[$year."-".$month] = $n."/".$nj; if($month==12){ $year++; @@ -265,8 +265,8 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); - $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); + $nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); $frag[$year."-".$month] = $n."/".$nj; if($month==12){ $year++; @@ -293,8 +293,8 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); - $nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count(); + $nj = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count(); $frag[$year."-".$month] = $n."/".$nj; if($month==12){ $year++; @@ -324,7 +324,7 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count(); + $n = $this->article_obj->where("ctime",">",$s_time)->where("state",">",-1)->where("ctime","<",$e_time)->count(); // $frag[$year."-".$month."sql"] = $this->article_obj->getLastSql(); $frag[$year."-".$month] = $n; if($month==12){ @@ -363,7 +363,7 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count(); + $n = $this->article_obj->where("state",">",-1)->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count(); $frag[$year."-".$month] = $n; if($month==12){ $year++; @@ -393,7 +393,7 @@ class Monitor extends Base while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count(); + $n = $this->article_obj->where("state",">",-1)->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count(); $frag[$year."-".$month] = $n; if($month==12){ $year++; diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php index b891df8..be5b6db 100644 --- a/application/api/controller/Preaccept.php +++ b/application/api/controller/Preaccept.php @@ -631,7 +631,8 @@ class Preaccept extends Base return jsonError($rule->getError()); } $doi = str_replace('/', '%2F', $data['doi']); - $url = "https://citation.crosscite.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US"; +// $url = "https://citation.crosscite.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US"; + $url = "https://citation.doi.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US"; $res = myGet($url); $frag = trim(substr($res, strpos($res, '.') + 1)); if ($frag == "") { diff --git a/application/common.php b/application/common.php index ef0b48e..aba59ae 100644 --- a/application/common.php +++ b/application/common.php @@ -711,6 +711,38 @@ function addUserScoreLog($user_id, $score, $content, $ctime, $act = '+') } +function getPaystationToken() +{ + $client_id = $_ENV['CLIENT_ID']; + $client_secret = $_ENV['CLIENT_SECRET']; + $access_token_url = $_ENV['API_URL'] . '/oauth/token'; + $guzzle = new Client(['base_uri' => $access_token_url]); + try { + $raw_response = $guzzle->post('', [ + 'headers' => ['Content-type' => 'application/json'], + 'body' => json_encode([ + 'client_id' => $client_id, + 'client_secret' => $client_secret, + 'grant_type' => 'client_credentials', + 'scope' => 'write' + ]), + ]); + $response = $raw_response->getBody()->getContents(); + if ($response) { + $response_decoded = json_decode($response); + if ($response_decoded && isset($response_decoded->access_token)) { + return $response_decoded->access_token; + } + return null; + } + } catch (\GuzzleHttp\Exception\GuzzleException $e) { + //@todo: Replace with your own error handling + return null; + } + return null; +} + + function my_doiToFrag2($data) { $p_refer_obj = Db::name('production_article_refer'); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a543845..aee4948 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -485,17 +485,17 @@ }, { "name": "myclabs/php-enum", - "version": "1.8.4", - "version_normalized": "1.8.4.0", + "version": "1.8.5", + "version_normalized": "1.8.5.0", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" + "reference": "e7be26966b7398204a234f8673fdad5ac6277802" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802", + "reference": "e7be26966b7398204a234f8673fdad5ac6277802", "shasum": "" }, "require": { @@ -505,9 +505,9 @@ "require-dev": { "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2" + "vimeo/psalm": "^4.6.2 || ^5.2" }, - "time": "2022-08-04T09:53:51+00:00", + "time": "2025-01-14T11:49:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -529,13 +529,13 @@ } ], "description": "PHP Enum implementation", - "homepage": "http://github.com/myclabs/php-enum", + "homepage": "https://github.com/myclabs/php-enum", "keywords": [ "enum" ], "support": { "issues": "https://github.com/myclabs/php-enum/issues", - "source": "https://github.com/myclabs/php-enum/tree/1.8.4" + "source": "https://github.com/myclabs/php-enum/tree/1.8.5" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index e97c31b..c464003 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'topthink/think', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '145b0ab8a5ed5ab6fd9c51ce4728a0e53c044f8c', + 'reference' => 'c0e20f5cfb541206bf97787e1967d2e7de3db339', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -83,9 +83,9 @@ 'dev_requirement' => false, ), 'myclabs/php-enum' => array( - 'pretty_version' => '1.8.4', - 'version' => '1.8.4.0', - 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', + 'pretty_version' => '1.8.5', + 'version' => '1.8.5.0', + 'reference' => 'e7be26966b7398204a234f8673fdad5ac6277802', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/php-enum', 'aliases' => array(), @@ -220,7 +220,7 @@ 'topthink/think' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '145b0ab8a5ed5ab6fd9c51ce4728a0e53c044f8c', + 'reference' => 'c0e20f5cfb541206bf97787e1967d2e7de3db339', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),