This commit is contained in:
wangjinlei
2025-02-06 11:24:08 +08:00
parent c0e20f5cfb
commit fb647bd6fa
5 changed files with 63 additions and 30 deletions

View File

@@ -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 ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_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 ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_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 ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_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 ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$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."-".$month."sql"] = $this->article_obj->getLastSql();
$frag[$year."-".$month] = $n;
if($month==12){
@@ -363,7 +363,7 @@ class Monitor extends Base
while ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_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 ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_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++;

View File

@@ -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 == "") {

View File

@@ -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');