This commit is contained in:
王金磊
2023-04-07 16:46:17 +08:00
parent e4be850ba1
commit fed98c4397
6 changed files with 264 additions and 212 deletions

View File

@@ -45,113 +45,6 @@ class Auto extends Controller
$this->user_cv_obj = Db::name('user_cv');
}
public function phpinfo()
{
phpinfo();
}
public function testEmail()
{
$journal_info = $this->journal_obj->where('journal_id', 4)->find();
$maidata['email'] = "751475802@qq.com";
$maidata['title'] = "test email";
$maidata['content'] = "test content";
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
sendEmail($maidata['email'], $journal_info['title'], $journal_info['title'], $maidata['title'], $journal_info['email'], $journal_info['epassword']);
}
public function resetReviewerPassword()
{
$list = $this->user_obj
->field("t_user.*")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user.user_id", "left")
->where("t_user_reviewer_info.reviewer_info_id", ">", 0)
->where("t_user.password", "e9f5c5240c0bb39488e6dbfbdb1517e0")
->where("t_user.state", 0)
->select();
echo '<pre>';
var_dump($list);
echo '</pre>';
die;
}
public function pctest1()
{
$url1 = "https://sky.yangtzeu.edu.cn/szdw/zzjs.htm";
$url2 = "https://sky.yangtzeu.edu.cn/szdw/dsyl.htm";
$result1 = self::pcread($url1);
$result2 = self::pcread($url2);
$preg = '/<a .*?href="(.*?)".*?>/is';
preg_match_all($preg, $result1, $array1);
preg_match_all($preg, $result2, $array2);
$arr = array_merge($array1[1],$array2[1]);
$array = [];
foreach ($arr as $v) {
if (stripos($v, '1009')) {
if(!stripos($v,'yangtzeu.edu')){
$array[] = "https://sky.yangtzeu.edu.cn/".substr($v,3);
}else{
$array[] = $v;
}
}
}
$frag = [];
foreach($array as $v){
$res = self::pcread($v);
preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r);
if(!isset($r[0])){
continue;
}
$str = strip_tags($r[0]);
$res_arr = explode(PHP_EOL,$str);
$cache = [];
$chc = [];
foreach($res_arr as $val){
if(stripos($val,'mail')){
$cache['email'] = str_replace("&nbsp;",' ',$val);
}else{
$chc[] = str_replace("&nbsp;",' ',$val);
}
}
$cache['name'] = str_replace("&nbsp;",' ',$res_arr[1]);
$cache['all'] = $chc;
$frag[] = $cache;
}
dump($frag);
// $res = self::pcread($array[1]);
// preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r);
// $str = strip_tags($r[0]);
// $res_arr = explode(PHP_EOL,$str);
// dump(explode(PHP_EOL,$str));
}
public function pcread($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止调用时就输出获取到的数据
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
/**
* 推送邮件给审稿人提醒审稿人
@@ -277,35 +170,6 @@ class Auto extends Controller
// }
public function qqqq()
{
$extension_obj = Db::name('exten');
$data = $this->request->post();
$num = $data['num'];
$limit_start = ($num - 1) * 1000;
$list = $extension_obj->limit($limit_start, 1000)->select();
$re['list'] = $list;
return jsonSuccess($re);
}
public function pppp()
{
$journal_abbr_obj = Db::name('journal_abbr');
$file = "D://bbbb.xlsx";
$res = $this->readExcel($file);
$f = [];
foreach ($res as $v) {
$cache['full_name'] = $v['full'];
$cache['little_name'] = $v['aa'];
$f[] = $cache;
// $company_top_obj->insert($cache);
}
$journal_abbr_obj->insertAll($f);
// // dump($res);
// $extension_obj->insertAll($res);
}
private function readExcel($path)
{
@@ -460,12 +324,6 @@ class Auto extends Controller
}
}
public function testrev()
{
$a = $this->article_obj->where('article_id', 261)->find();
// $this->checkrev($a);
}
/**
* 处理过期审稿
*/
@@ -483,21 +341,6 @@ class Auto extends Controller
}
}
public function testmail()
{
$maidata['email'] = '751475802@qq.com';
$maidata['title'] = 'testdsdsasaddsasdaadsasd' . date('Ymd His', time());
$maidata['content'] = 'dsadsaas';
$maidata['tmail'] = 'tmrcancer@tmrjournals.com';
$maidata['tpassword'] = 'Wu999999tmrcance';
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
public function mytest()
{
echo 'okokokook!!!!';
}
/**
* 审查文章审稿人状态,返回结果
*/