Commit b72e4b77 authored by shajiaiming's avatar shajiaiming

fix

parent 94b09038
...@@ -24,21 +24,19 @@ class WarnController extends Controller ...@@ -24,21 +24,19 @@ class WarnController extends Controller
if ($key == 2) { if ($key == 2) {
$string = HtmlDomParser::str_get_html($e->innertext); $string = HtmlDomParser::str_get_html($e->innertext);
if ($string->find('td')) { if ($string->find('td')) {
foreach ($string->find('td') as $i => $td) { if (strpos($string->find('td')[2]->innertext, '暂未公布') !== false) {
if (strpos($string->find('td')[2]->innertext, '暂未公布') !== false) { return 0;
} else {
$redis->set('status', date('Y-m-d H:i:s'));
try {
$mail = \Yii::$app->mailer->compose();
$mail->setFrom('sjm@33.cn');
$mail->setTo('sjm@33.cn');
$mail->setSubject("2020浙江事业单位统考笔试成绩");
$mail->setHtmlBody("<h1>笔试成绩已发布!,进面最高分:" . $string->find('td')[3]->innertext . ";进面最低分:" . $string->find('td')[4]->innertext . "</h1>");
$mail->send();
} catch (\ErrorException $e) {
return 0; return 0;
} else {
$redis->set('status', date('Y-m-d H:i:s'));
try {
$mail = \Yii::$app->mailer->compose();
$mail->setFrom('sjm@33.cn');
$mail->setTo('sjm@33.cn');
$mail->setSubject("2020浙江事业单位统考笔试成绩");
$mail->setHtmlBody("<h1>笔试成绩已发布!,进面最高分:" . $string->find('td')[3]->innertext . ";进面最低分:" . $string->find('td')[4]->innertext . "</h1>");
$mail->send();
} catch (\ErrorException $e) {
return 0;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment