From 0fcd011664e722fedb124605dee03f2cf4db8870 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Fri, 6 Dec 2024 15:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=94=A8=E6=88=B7=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=94=9F=E6=B4=BB=E4=BB=98=E6=AC=BE=E8=B7=B3=E8=BD=AC=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BillionsLogic.php | 4 ++++ app/common/logic/Billions.php | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/api/logic/BillionsLogic.php b/app/api/logic/BillionsLogic.php index bf806b4a..9006a1aa 100755 --- a/app/api/logic/BillionsLogic.php +++ b/app/api/logic/BillionsLogic.php @@ -122,11 +122,15 @@ class BillionsLogic extends Logic ->where("residue_price",">","0") ->where("user_start_price",">","0") ->select()->toArray(); + if(count($result)<1){ + return false; + } foreach($result as $key=>$value){ $result = Db::name("user_billions_surplus_log") ->where("surplus_id",$value['surplus_id']) ->where("user_billion_id",$billion) ->find(); + if($value['billions_id']>=$billion){ if($result == null){ $d['surplus_id'] = $value['surplus_id']; diff --git a/app/common/logic/Billions.php b/app/common/logic/Billions.php index 662f45a9..f7059052 100644 --- a/app/common/logic/Billions.php +++ b/app/common/logic/Billions.php @@ -36,6 +36,7 @@ class Billions $data['dtime'] = date("Y-m-d H:i:s"); $data['type'] = $order['type']; // 类型是充值 $data['subsidy_price'] = round($order['order_amount'] * $user_subsidy / 100,8); + $data['withdrawal_amount'] = $data['subsidy_price']; $res = Db::name("user_billions")->insertGetId($data); $subsidy = $order['order_amount'] * $all_user_subsidy / 100; if($is_d != null){ @@ -79,7 +80,7 @@ class Billions } }else{ $d['user_id'] = $v['user_id']; - $d['total_amount'] = $v['order_price']; + $d['total_amount'] = round($v['order_price']-$v['available_amount'],8); $first_update_subsidy_withdrawal = Db::name("subsidy_withdrawal")->insertGetId($d); if(!$first_update_subsidy_withdrawal){ return -4; @@ -88,14 +89,14 @@ class Billions $dat['user_id'] = $v['user_id']; $dat['billions_id'] = $v['billions_id']; $dat['type'] = 1; - $dat['money'] = $v['order_price']; + $dat['money'] = $d['total_amount'] ; $dat['create_time'] = date("Y-m-d H:i:s"); // 插入提现记录 $first_save_record = Db::name("subsidy_withdrawal_record")->save($dat); if ($first_save_record) { $send = array( 'user_id' => $v['user_id'], - 'money' => $v['order_price'] + 'money' => $d['total_amount'] ); sendBillionsSubsidySMS($send); }