chuan 1 month ago
parent
commit
b7dc039884
  1. 29
      app/admin/service/RechargeService.php
  2. 6
      app/home/service/BlockStockService.php
  3. 2
      app/home/service/PayService.php

29
app/admin/service/RechargeService.php

@ -10,6 +10,7 @@ use app\model\PaymentCodeLogModel;
use app\model\PaymentListModel;
use app\model\RechargeApplyModel;
use app\model\UserModel;
use think\facade\Log;
class RechargeService extends AdminBaseService
{
@ -73,6 +74,20 @@ class RechargeService extends AdminBaseService
$rows[$key]['user_no'] = $userNoArr[$item['user_id']] ?? '-'; // 用户号
$rows[$key]['order_id'] = $item['order_no'];
$rows[$key]['recharge_channel'] = PaymentListModel::where('id', $item['recharge_channel'])->value('channel');
$paymentCodeLog = PaymentCodeLogModel::where('recharge_apply_id', $item['id'])->find();
if (!empty($paymentCodeLog)) {
$paymentCodeLog = $paymentCodeLog->toArray();
$paymentConfig = PaymentCodeConfigModel::where('id', $paymentCodeLog['payment_code_config_id'])->find();
if (!empty($paymentConfig)) {
$paymentConfig = $paymentConfig->toArray();
}
}
$rows[$key]['payment_code_log'] = $paymentCodeLog;
$rows[$key]['payment_code_config'] = $paymentConfig ?? [];
}
}
return $this->toData('0', 'SUCCESS', ['total' => $total, 'list' => $rows, 'sum' => $sum . 'USD', 'extend' => $statusList]);
@ -137,13 +152,17 @@ class RechargeService extends AdminBaseService
}
$info = RechargeApplyModel::getOrderInfo($where);
if ($info) {
if ($info['is_online'] == 1){
return $this->toData('10040', '在线充值 不可操作');
}
// if ($info['is_online'] == 1){
// return $this->toData('10040', '在线充值 不可操作');
// }
if ($info['is_check'] == 0) {
if ($param['check_status'] == 1) {
$result = $this->updateUserAsset($info['user_id'], $info['account_type'], 1, $info['market_amount'], 0, $info['order_no']);
if ($param['real_amount'] > 0 ){
$result = $this->updateUserAsset($info['user_id'], $info['account_type'], 1, $param['real_amount'], 0, $info['order_no']);
} else {
$result = $this->updateUserAsset($info['user_id'], $info['account_type'], 1, $info['market_amount'], 0, $info['order_no']);
}
if ($result['status'] == 200) {
RechargeApplyModel::where('id', $info['id'])->update([
'real_amount' => $param['real_amount'] ?? 0, // 实际到账金额,审核时候运营人员手动输入的
@ -152,7 +171,7 @@ class RechargeService extends AdminBaseService
'deal_time' => date('Y-m-d H:i:s')
]);
} else {
return $this->toData('1015', '系统异常 请稍后重试');
return $this->toData('1015', '系统异常 请稍后重试', $result);
}
} else {
RechargeApplyModel::where('id', $info['id'])->update([

6
app/home/service/BlockStockService.php

@ -19,14 +19,14 @@ class BlockStockService extends BaseHomeService
}
// stock_type 3 美股 4 印尼 5 马股 6 泰股 9 新加坡股票
if (empty($param['type']) || !in_array($param['type'], ['3', '4', '5', '6', '7', '9', '12'])) {
if (empty($param['type']) || !in_array($param['type'], ['3', '4', '5', '6', '7', '9', '12', '18'])) {
return $this->toData('1', 'Params error');
}
$list = StockBlockListModel::where('type', $param['type'])->page($param['page'], $param['limit'])->select();
$total = StockBlockListModel::where('type', $param['type'])->count();
$redisKeyArr = [3 => 'US', 4 => 'Indonesia', 5 => 'Malaysia', 6 => 'Thailand', 7 => 'India', 9 => 'Singapore', 12 => 'HongKong'];
$redisKeyArr = [3 => 'US', 4 => 'Indonesia', 5 => 'Malaysia', 6 => 'Thailand', 7 => 'India', 9 => 'Singapore', 12 => 'HongKong', 18=>'Japan'];
$redis = $this->getRedis();
foreach ($list as &$v) {
@ -35,7 +35,7 @@ class BlockStockService extends BaseHomeService
}
return $this->toData('0', 'SUCCESS', ['list' => $list, 'total' => $total,]);
} catch (\Exception $exception) {
return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage()]);
return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage(), $exception->getTrace()]);
}
}

2
app/home/service/PayService.php

@ -56,7 +56,7 @@ class PayService extends BaseHomeService
if ($data['recharge_type'] == 2) {
// 如果是支付码方式充值,需要上传该参数,该参数值是payment_code_config表的主键ID
if (empty($data['payment_code_config_log_id'])) {
return $this->toData('500', 'Parameter payment_code_config_id is messing');
return $this->toData('500', 'Parameter payment_code_config_log_id is messing');
}
// 创建订单
$orderData = RechargeApplyModel::create([

Loading…
Cancel
Save