53 lines
1.8 KiB
PHP
53 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* SaaSMall商城系统 - 团队十年电商经验汇集巨献!
|
|
* =========================================================
|
|
* Copy right 2019-2029 成都SAAS云科技有限公司, 保留所有权利。
|
|
* ----------------------------------------------
|
|
* 官方网址: https://www.gobuysaas.com
|
|
* =========================================================
|
|
*/
|
|
|
|
namespace addon\commission\event;
|
|
|
|
|
|
use addon\commission\job\CreateRecordJob;
|
|
use addon\commission\job\GiveWeightValueJob;
|
|
use addon\commission\job\UseLegumesIntegralJob;
|
|
use think\Exception;
|
|
use think\facade\Log;
|
|
use think\facade\Queue;
|
|
|
|
class OrderPay{
|
|
// 订单支付成功
|
|
public function handle($params){
|
|
// var_dump($params);die;
|
|
// trace($params, '平台抽成 - 支付成功');
|
|
try{
|
|
// 支付成功 - 生成抽成记录
|
|
Queue::push(CreateRecordJob::class,[
|
|
'member_id' => (int)$params['member_id'],
|
|
'order_id' => (int)$params['order_id']
|
|
]);
|
|
// 支付成功 - 赠送权重值
|
|
Queue::push(GiveWeightValueJob::class,[
|
|
'member_id' => (int)$params['member_id'],
|
|
'order_id' => (int)$params['order_id'],
|
|
'site_id' => (int)$params['site_id']
|
|
]);
|
|
// 非普通订单支付成功 减少豆豆积分
|
|
$orderType = model('order')->getValue(['order_id' => (int)$params['order_id']], 'order_type');
|
|
if($orderType != 1){
|
|
Queue::push(UseLegumesIntegralJob::class,[
|
|
'order_id' => (int)$params['order_id'],
|
|
]);
|
|
}
|
|
}catch(Exception $e){
|
|
trace($e->getMessage(), '平台抽成 - 支付成功 - 错误');
|
|
}
|
|
return success();
|
|
}
|
|
|
|
|
|
}
|