更新
This commit is contained in:
parent
f83ff91c64
commit
f0d4d0589e
app
@ -49,6 +49,9 @@ class RechargeLogic extends BaseLogic
|
||||
if(isset($params['task_id']) &&$params['task_id']>0){
|
||||
$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);
|
||||
|
||||
return [
|
||||
|
@ -16,6 +16,7 @@ namespace app\common\logic;
|
||||
|
||||
use app\common\enum\PayEnum;
|
||||
use app\common\enum\user\AccountLogEnum;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\company\CompanyAccountLog;
|
||||
use app\common\model\recharge\RechargeOrder;
|
||||
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)]);
|
||||
TaskTemplate::where('id', $find['template_id'])->update(['over_decimal' => $order->order_amount]);
|
||||
} 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->total_recharge_amount += $order->order_amount;
|
||||
@ -87,6 +106,8 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order->sn,
|
||||
'用户充值'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 更新充值订单状态
|
||||
|
Loading…
x
Reference in New Issue
Block a user