|
|
@@ -5,6 +5,7 @@ namespace app\common\logic;
|
|
|
use app\common\library\Log;
|
|
|
use app\common\model\LedgerOrderPayLogModel;
|
|
|
use app\common\model\LedgerOrderPayModel;
|
|
|
+use app\common\model\LedgerTokenChangeModel;
|
|
|
use app\common\model\LedgerWalletModel;
|
|
|
use app\common\model\OfflineRechargePayLogModel;
|
|
|
use app\common\model\OfflineRechargeRecordModel;
|
|
|
@@ -89,25 +90,22 @@ class OrderPay
|
|
|
case 1://产品
|
|
|
$uid = $item['user_id'];
|
|
|
$amount= $item['amount'];
|
|
|
- $power = $item['power'];
|
|
|
+ $num = $item['cha_bao'];
|
|
|
|
|
|
// 启动事务
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
- // 更新总算力和账变
|
|
|
- (new LedgerWalletModel)->changeWalletAccount($uid, Asset::POWER, $power, Action::PowerRentalPower, $item['id']);
|
|
|
-
|
|
|
-// // 更新服务器算力,不账变
|
|
|
-// (new LedgerWalletModel)->changeWalletOnly($uid, Asset::RENTAL_POWER, $power);
|
|
|
-
|
|
|
- // 更新自己(有效会员时间)和所有上级的信息(有效直推人数和团队总算力)
|
|
|
- (new UserModel())->updateForRental($uid, $power);
|
|
|
-
|
|
|
-// // 发放直推USDT收益
|
|
|
- (new LedgerWalletModel)->sendUsdtProfit($uid, $amount);
|
|
|
-
|
|
|
- // 发放直推算力收益
|
|
|
- (new LedgerWalletModel)->sendDirectProfit($uid, $power);
|
|
|
+ //充值茶宝
|
|
|
+ (new LedgerWalletModel)->changeWalletAccount($uid, Asset::TOKEN, $num, LedgerTokenChangeModel::Recharge, $item['id']);
|
|
|
+//
|
|
|
+// // 更新自己(有效会员时间)和所有上级的信息(有效直推人数和团队总算力)
|
|
|
+// (new UserModel())->updateForRental($uid, $power);
|
|
|
+//
|
|
|
+//// // 发放直推USDT收益
|
|
|
+// (new LedgerWalletModel)->sendUsdtProfit($uid, $amount);
|
|
|
+//
|
|
|
+// // 发放直推算力收益
|
|
|
+// (new LedgerWalletModel)->sendDirectProfit($uid, $power);
|
|
|
|
|
|
// // 间推奖
|
|
|
// (new LedgerWalletModel)->sendGenerateProfit($uid, $amount);
|
|
|
@@ -137,6 +135,11 @@ class OrderPay
|
|
|
*/
|
|
|
public function updateOrderPayStatus($pay_info, $to_address)
|
|
|
{
|
|
|
+ $pay_info['from_address'] = strtolower($pay_info['from_address']);
|
|
|
+ if($pay_info['from_address'] != strtolower($pay_info['user_info']['address'])){
|
|
|
+ return _error('from_adress不一致:用户地址:' . $pay_info['user_info']['address'] . ',充值表地址' . $pay_info['from_address']);
|
|
|
+ }
|
|
|
+
|
|
|
$get_transaction_info = (new MyBscApi())->getInfoByTransactionHash($pay_info['tx_hash']);
|
|
|
if($get_transaction_info['code'] == 0){
|
|
|
return $get_transaction_info;
|
|
|
@@ -146,7 +149,7 @@ class OrderPay
|
|
|
if(!$hash_info['success']){
|
|
|
return _error('交易失败');
|
|
|
}
|
|
|
- $pay_info['from_address'] = strtolower($pay_info['user_info']['address']);
|
|
|
+ //$pay_info['from_address'] = strtolower($pay_info['user_info']['address']);
|
|
|
$pay_info['to_address'] = strtolower($to_address);
|
|
|
|
|
|
$hash_info['from_address'] = strtolower($hash_info['from_address']);
|