Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
32486097
authored
Dec 23, 2022
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
钉钉消息通知
parent
27fef5a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
app/Http/Controllers/HomeController.php
app/helpers.php
app/Http/Controllers/HomeController.php
View file @
32486097
...
...
@@ -26,6 +26,16 @@ class HomeController extends Controller
*/
public
function
index
()
{
// $data = [
// 'name'=>rand(100,100000),
// 'inquiry_sn'=>rand(100,100000),
// ];
// $res = SendMsg($data,'semour_inquire',['13713025362']);
// print_r($res);
// die();
return
view
(
'home.home'
);
}
}
app/helpers.php
View file @
32486097
...
...
@@ -26,6 +26,36 @@ if (!function_exists('generate_letters')) {
}
/*
* 发送信息
* @param array $data 替换的内容数组,["name"=>"小红"]
* @param string $key 在消息系统新建的模板编号,如:
semour_inquire 深茂询价消息
semour_order 深茂订单消息
* @param array $ToUser 指定接收人 [13713025362,13713025363]
*/
function
SendMsg
(
$data
=
[],
$key
=
''
,
$ToUser
=
'INNER_PERSON'
){
if
(
$key
==
""
){
return
false
;
}
$touser_json
=
json_encode
(
$ToUser
);
$check
[
'touser'
]
=
$touser_json
;
$check
[
'data'
]
=
urldecode
(
json_encode
(
$data
,
JSON_UNESCAPED_UNICODE
));
# $check['data'] ="{\"goods_name\":\"MPVZ5004GW7U\",\"brand_name\":\"恩智浦牌\\/NXP牌\",\"goods_title\":\"多元件集成电路\",\"material_sn\":\"WL2021060300070421\",\"tax_rate_low\":\"0.7000\",\"tax_rate_land\":\"0.0000\",\"tax_rate_added\":\"13.0000\",\"supervision_con\":\"\",\"number\":\"8542391000\"}";
$check
[
'pf'
]
=
1
;
$check
[
'keyword'
]
=
$key
;
$check
[
'is_ignore'
]
=
0
;
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
MD5
(
MD5
(
$check
[
'k1'
])
.
"fh6y5t4rr351d2c3bryi"
);
$response
=
Http
::
asForm
()
->
post
(
"http://api.ichunt.com/msg/sendMessageByAuto"
,
$check
);
$res
=
json_decode
(
$response
->
body
(),
true
);
if
(
empty
(
$res
[
'err_code'
])
||
$res
[
'err_code'
]
!=
0
)
return
false
;
return
true
;
}
/*
* 反爬虫用html标签替换数字,不包括“.”
* $number 数字串
*/
...
...
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