更新
This commit is contained in:
parent
f83ff91c64
commit
f0d4d0589e
@ -49,6 +49,9 @@ class RechargeLogic extends BaseLogic
|
|||||||
if(isset($params['task_id']) &&$params['task_id']>0){
|
if(isset($params['task_id']) &&$params['task_id']>0){
|
||||||
$data['extend']=json_encode(['task_id'=>$params['task_id'],'type'=>1]);
|
$data['extend']=json_encode(['task_id'=>$params['task_id'],'type'=>1]);
|
||||||
}
|
}
|
||||||
|
if(isset($params['type']) &&$params['type']==300){
|
||||||
|
$data['change_type']=300;
|
||||||
|
}
|
||||||
$order = RechargeOrder::create($data);
|
$order = RechargeOrder::create($data);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -16,6 +16,7 @@ namespace app\common\logic;
|
|||||||
|
|
||||||
use app\common\enum\PayEnum;
|
use app\common\enum\PayEnum;
|
||||||
use app\common\enum\user\AccountLogEnum;
|
use app\common\enum\user\AccountLogEnum;
|
||||||
|
use app\common\model\Company;
|
||||||
use app\common\model\company\CompanyAccountLog;
|
use app\common\model\company\CompanyAccountLog;
|
||||||
use app\common\model\recharge\RechargeOrder;
|
use app\common\model\recharge\RechargeOrder;
|
||||||
use app\common\model\task\Task;
|
use app\common\model\task\Task;
|
||||||
@ -72,6 +73,24 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
Task::where('id', $order['extend']['task_id'])->update(['status' => 3,'extend'=>json_encode($extend)]);
|
Task::where('id', $order['extend']['task_id'])->update(['status' => 3,'extend'=>json_encode($extend)]);
|
||||||
TaskTemplate::where('id', $find['template_id'])->update(['over_decimal' => $order->order_amount]);
|
TaskTemplate::where('id', $find['template_id'])->update(['over_decimal' => $order->order_amount]);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if($order['change_type']==300){
|
||||||
|
$company=Company::where('user_id',$order['user_id'])->find();
|
||||||
|
$left_amount= $company['deposit']+$order->order_amount;
|
||||||
|
$datas = [
|
||||||
|
'order_sn' => $order->sn,
|
||||||
|
'user_id' => $order->user_id,
|
||||||
|
'company_id' => $company['id']??0,
|
||||||
|
'change_type' => 300,
|
||||||
|
'change_object' => 2,
|
||||||
|
'action' => 1,
|
||||||
|
'change_amount' => $order->order_amount,
|
||||||
|
'left_amount' =>$left_amount,
|
||||||
|
'remark' => '保证金充值',
|
||||||
|
];
|
||||||
|
CompanyAccountLog::create($datas);
|
||||||
|
Company::where('id',$company['id'])->update(['deposit'=>$left_amount]);
|
||||||
|
}else{
|
||||||
// 增加用户累计充值金额及用户余额
|
// 增加用户累计充值金额及用户余额
|
||||||
$user = User::findOrEmpty($order->user_id);
|
$user = User::findOrEmpty($order->user_id);
|
||||||
$user->total_recharge_amount += $order->order_amount;
|
$user->total_recharge_amount += $order->order_amount;
|
||||||
@ -89,6 +108,8 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 更新充值订单状态
|
// 更新充值订单状态
|
||||||
$order->transaction_id = $extra['transaction_id'];
|
$order->transaction_id = $extra['transaction_id'];
|
||||||
$order->pay_status = PayEnum::ISPAID;
|
$order->pay_status = PayEnum::ISPAID;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user