fix(workWechat): 修复推送产品信息到企业微信的功能
- 在发送消息前增加对 URL 的判断,确保只在生产环境发送 - 优化了代码结构,提高了代码的可读性和维护性
This commit is contained in:
parent
2580957b71
commit
afc39e852a
@ -11,6 +11,7 @@ class ProductOffer
|
||||
{
|
||||
try {
|
||||
$url = getenv('PUSHPRODUCTOFFER');
|
||||
if($url){
|
||||
$order_id = $data['order_id'];
|
||||
$store_name = $data['store_name'];
|
||||
$num = $data['buyer_nums'];
|
||||
@ -30,6 +31,7 @@ class ProductOffer
|
||||
>支付方式:<font color=\"comment\">$pay_type</font>
|
||||
[下载今日采购表格]($urls)"]];
|
||||
(new Curl())->postJson($url, json_encode($arr, true));
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('推送商品信息保存:'.$e->getMessage());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user