Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
5b437aa9
Commit
5b437aa9
authored
Aug 14, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into develop
parents
9d735913
94b09038
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
3 deletions
+51
-3
OperationLogInterceptor.php
common/behaviors/OperationLogInterceptor.php
+1
-3
WarnController.php
console/controllers/WarnController.php
+50
-0
No files found.
common/behaviors/OperationLogInterceptor.php
View file @
5b437aa9
...
@@ -27,14 +27,12 @@ class OperationLogInterceptor extends ActionFilter
...
@@ -27,14 +27,12 @@ class OperationLogInterceptor extends ActionFilter
// }
// }
if
(
'asset'
==
$handerClass
)
{
if
(
'asset'
==
$handerClass
)
{
$uri
=
Yii
::
$app
->
request
->
post
(
'uri'
,
''
);
$uri
=
Yii
::
$app
->
request
->
post
(
'uri'
,
''
);
if
(
isset
(
Yii
::
$app
->
params
[
'handleTableAndDesc'
][
'handleTableAndDesc'
][
$handerClass
][
$handlerAction
][
$uri
]))
{
$params
=
[
$params
=
[
'ip'
=>
Yii
::
$app
->
request
->
userIP
,
'ip'
=>
Yii
::
$app
->
request
->
userIP
,
'operation'
=>
'操作'
,
'operation'
=>
'操作'
,
'business'
=>
Yii
::
$app
->
params
[
'handleTableAndDesc'
][
'handleTableAndDesc'
][
$handerClass
][
$handlerAction
][
$uri
]
??
$handerClass
.
'-'
.
$handlerAction
,
'business'
=>
isset
(
Yii
::
$app
->
params
[
'handleTableAndDesc'
][
'handleTableAndDesc'
][
$handerClass
][
$handlerAction
][
$uri
])
?
Yii
::
$app
->
params
[
'handleTableAndDesc'
][
'handleTableAndDesc'
][
$handerClass
][
$handlerAction
][
$uri
]
:
$uri
,
'table'
=>
'asset'
'table'
=>
'asset'
];
];
}
}
else
{
}
else
{
switch
(
$method
)
{
switch
(
$method
)
{
case
"get"
:
case
"get"
:
...
...
console/controllers/WarnController.php
0 → 100644
View file @
5b437aa9
<?php
namespace
console\controllers
;
use
linslin\yii2\curl\Curl
;
use
voku\helper\HtmlDomParser
;
use
yii\console\Controller
;
class
WarnController
extends
Controller
{
public
function
actionAuto
()
{
$redis
=
\Yii
::
$app
->
redis_user
;
if
(
!
$redis
->
EXISTS
(
"status"
))
{
$curl
=
new
Curl
();
$url
=
'http://www.offcn.com/sydw/2020/0813/571289.html?www.offcn.com-hengtong'
;
$response
=
$curl
->
get
(
$url
);
$html
=
HtmlDomParser
::
str_get_html
(
$response
);
$tbody
=
(
$html
->
find
(
'tbody'
));
if
(
$tbody
->
find
(
'tr'
))
{
foreach
(
$tbody
->
find
(
'tr'
)
as
$key
=>
$e
)
{
if
(
$key
==
2
)
{
$string
=
HtmlDomParser
::
str_get_html
(
$e
->
innertext
);
if
(
$string
->
find
(
'td'
))
{
foreach
(
$string
->
find
(
'td'
)
as
$i
=>
$td
)
{
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
;
}
}
}
}
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment