diff --git a/app/common/logic/Billions.php b/app/common/logic/Billions.php index 86a0a44b..1bbb71d1 100644 --- a/app/common/logic/Billions.php +++ b/app/common/logic/Billions.php @@ -35,9 +35,28 @@ class Billions $data['order_id'] = $order['id']; $data['dtime'] = date("Y-m-d H:i:s"); $data['type'] = $order['type']; // 类型是充值 - $data['subsidy_price'] = round($order['order_amount'] * $user_subsidy / 100,8); + if( $order['type'] == 5){ + $data['subsidy_price'] = round(2*$order['order_amount'] * $user_subsidy / 100,8); + }else{ + $data['subsidy_price'] = round($order['order_amount'] * $user_subsidy / 100,8); + } +// $data['subsidy_price'] = round($order['order_amount'] * $user_subsidy / 100,8); $data['withdrawal_amount'] = $data['subsidy_price']; $res = Db::name("user_billions")->insertGetId($data); + if($lstore_id!=""){ + $store_msg = Db::name("local_store")->where("lstore_id",$lstore_id)->find(); + $dsa['order_price'] = round(0.5*$order['order_amount'],8); // 改为充值金额 + $dsa['user_id'] = $store_msg['user_id']; + $dsa['goods_id'] = 0; // 充值接口不需要该参数 + $dsa['shop_id'] = 0; // 充值接口不需要该参数 + $dsa['goods_num'] = 1; // 充值接口设置为1 + $dsa['order_id'] = $order['id'].$store_msg['lstore_id']; + $dsa['dtime'] = date("Y-m-d H:i:s"); + $dsa['type'] = $order['type']; // 类型是充值 + $dsa['subsidy_price'] = 0; + $dsa['withdrawal_amount'] = $data['subsidy_price']; + Db::name("user_billions")->save($dsa); + } $subsidy = $order['order_amount'] * $all_user_subsidy / 100; if($is_d != null){ $ufl = round($subsidy*$user_first_leader/100,8);