feat(PayNotifyLogic): 添加新功能,推送新订单信息至指定URL

This commit is contained in:
mkm 2024-06-27 15:33:35 +08:00
parent eff3a9a2c6
commit 855c600f2b

View File

@ -25,6 +25,7 @@ use app\common\model\user\UserAddress;
use app\common\model\user\UserRecharge;
use app\common\model\user\UserShip;
use app\common\model\user_sign\UserSign;
use app\common\service\Curl;
use app\common\service\PushService;
use support\Log;
use think\facade\Db;
@ -585,6 +586,19 @@ class PayNotifyLogic extends BaseLogic
$financeLogic = new StoreFinanceFlowLogic();
$user_sing = new UserSign();
$off_activity = Config::where('name', 'off_activity')->value('value');
try{
$url=getenv('WETCHA_PUSH');
if($url){
$order_id=$order['order_id'];
$pay_price=$order['pay_price'];
$arr=["msgtype"=>"markdown","markdown"=>["content"=> "有新的订单请及时跟踪\n
>单号:<font color=\"comment\">$order_id</font>
>金额:<font color=\"comment\">$pay_price</font>"]];
(new Curl())->post($url,$arr);
}
}catch(\Exception $e){
Log::error('推送订单失败',['order_id'=>$order['id'],'error'=>$e->getMessage()]);
}
if ($off_activity == 1) {
//-----活动价结算更改
$financeLogic->order = $order;