|
@ -28,7 +28,8 @@ use app\model\UserStockJpLogModel; |
|
|
use app\model\UserStockJpModel; |
|
|
use app\model\UserStockJpModel; |
|
|
use app\model\UserStockLogModel; |
|
|
use app\model\UserStockLogModel; |
|
|
use app\model\UserStockModel; |
|
|
use app\model\UserStockModel; |
|
|
use app\model\UserVerifyLogModel; |
|
|
use app\model\VipCodeModel; |
|
|
|
|
|
use app\model\WatchVideoLogModel; |
|
|
use app\utility\Jwt; |
|
|
use app\utility\Jwt; |
|
|
use app\utility\UnqId; |
|
|
use app\utility\UnqId; |
|
|
use think\exception\ValidateException; |
|
|
use think\exception\ValidateException; |
|
@ -127,8 +128,6 @@ class UserService extends BaseHomeService |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -219,7 +218,7 @@ class UserService extends BaseHomeService |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 检测用户是否为有效VIP |
|
|
// 检测用户是否为有效VIP [判断规则 - 用户购买过VIP, 每个VIP有效期30天] |
|
|
$isVip = false; |
|
|
$isVip = false; |
|
|
$vipExpire = ""; //vip到期时间 |
|
|
$vipExpire = ""; //vip到期时间 |
|
|
$vipType = ""; // vip类型:青铜、白金、钻石; (管理端赠送的vip,以及vip兑换码兑换的都是显示免费标签) |
|
|
$vipType = ""; // vip类型:青铜、白金、钻石; (管理端赠送的vip,以及vip兑换码兑换的都是显示免费标签) |
|
@ -240,16 +239,13 @@ class UserService extends BaseHomeService |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 用户是实名信息 |
|
|
// 获取用户观看video的最后一个记录ID |
|
|
$verifyName = ""; |
|
|
$watchVideoLogId = 0; |
|
|
$verifySurname = ""; |
|
|
$watchVideoLog = WatchVideoLogModel::where(['user_id' => $userId])->find(); |
|
|
$verifyInfo = UserVerifyLogModel::where(['user_id'=>$userId])->find(); |
|
|
if (!empty($watchVideoLog)) { |
|
|
if (!empty($verifyInfo)){ |
|
|
$watchVideoLogId = $watchVideoLog->video_id; |
|
|
$verifyName = $verifyInfo->name; |
|
|
|
|
|
$verifySurname = $verifyInfo->surname; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 返回数据 |
|
|
// 返回数据 |
|
|
return $this->toData('0', 'Modification successful.', [ |
|
|
return $this->toData('0', 'Modification successful.', [ |
|
|
'logo' => $headPath, |
|
|
'logo' => $headPath, |
|
@ -286,8 +282,7 @@ class UserService extends BaseHomeService |
|
|
'customer_remark' => $info['customer_remark'], |
|
|
'customer_remark' => $info['customer_remark'], |
|
|
'label' => $info['label'], |
|
|
'label' => $info['label'], |
|
|
'adjust_channel' => $info['adjust_channel'], |
|
|
'adjust_channel' => $info['adjust_channel'], |
|
|
'verify_name' => $verifyName, |
|
|
'watch_video_id' => $watchVideoLogId, // 没看过就是0, 看过就返回的最后一次看的video_id |
|
|
'verify_surname' => $verifySurname, |
|
|
|
|
|
]); |
|
|
]); |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
@ -312,26 +307,27 @@ class UserService extends BaseHomeService |
|
|
} |
|
|
} |
|
|
// 购买vip所需的货币类型检测 [产品确定使用美股支付 USD] |
|
|
// 购买vip所需的货币类型检测 [产品确定使用美股支付 USD] |
|
|
if (empty($vipPurchaseCfg['stock_id'])) { |
|
|
if (empty($vipPurchaseCfg['stock_id'])) { |
|
|
return $this->toData('501', lang('data_configuration_error')); |
|
|
return $this->toData('500', lang('data_configuration_error')); |
|
|
} |
|
|
} |
|
|
$stockId = $vipPurchaseCfg['stock_id']; |
|
|
$stockId = $vipPurchaseCfg['stock_id']; |
|
|
// vip类型配置检测 |
|
|
// vip类型配置检测 |
|
|
if (!isset($vipPurchaseCfg[$param['vip_type']])) { |
|
|
if (!isset($vipPurchaseCfg[$param['vip_type']])) { |
|
|
return $this->toData('502', lang('data_configuration_error')); |
|
|
return $this->toData('500', lang('data_configuration_error')); |
|
|
} |
|
|
} |
|
|
$tagVipConfig = $vipPurchaseCfg[$param['vip_type']]; |
|
|
$tagVipConfig = $vipPurchaseCfg[$param['vip_type']]; |
|
|
// vip价格检测 |
|
|
// vip价格检测 |
|
|
if (!isset($tagVipConfig['vip_price']) || $tagVipConfig['vip_price'] <= 0) { |
|
|
if (!isset($tagVipConfig['vip_price']) || $tagVipConfig['vip_price'] <= 0) { |
|
|
return $this->toData('503', lang('data_configuration_error')); |
|
|
return $this->toData('500', lang('data_configuration_error')); |
|
|
} |
|
|
} |
|
|
// vip有效天数检测 |
|
|
// vip有效天数检测 |
|
|
if (!isset($tagVipConfig['vip_day']) || $tagVipConfig['vip_day'] <= 0) { |
|
|
if (!isset($tagVipConfig['vip_day']) || $tagVipConfig['vip_day'] <= 0) { |
|
|
return $this->toData('504', lang('data_configuration_error')); |
|
|
return $this->toData('500', lang('data_configuration_error')); |
|
|
} |
|
|
} |
|
|
// 查询用户余额是否足够 |
|
|
// 查询用户余额是否足够 |
|
|
|
|
|
// $userMoney = UserStockModel::where(['user_id'=>$userId,'stock_id'=> $stockId])->find(); |
|
|
$userMoney = UserStockJpModel::where(['user_id' => $userId, 'stock_id' => $stockId])->find(); |
|
|
$userMoney = UserStockJpModel::where(['user_id' => $userId, 'stock_id' => $stockId])->find(); |
|
|
if (empty($userMoney)) { |
|
|
if (empty($userMoney)) { |
|
|
return $this->toData('500', lang('user_usd_balance_is_insufficient')); |
|
|
return $this->toData('500', lang('user_balance_is_insufficient')); |
|
|
} |
|
|
} |
|
|
$userMoneyNum = (int)$userMoney->usable_num; |
|
|
$userMoneyNum = (int)$userMoney->usable_num; |
|
|
if ($userMoneyNum < $tagVipConfig['vip_price']) { |
|
|
if ($userMoneyNum < $tagVipConfig['vip_price']) { |
|
@ -345,6 +341,7 @@ class UserService extends BaseHomeService |
|
|
// 扣除用户金额 |
|
|
// 扣除用户金额 |
|
|
UserStockJpModel::where(['user_id' => $userId, 'stock_id' => $stockId])->where('usable_num', ">=", $vipPrice)->dec('usable_num', $vipPrice)->update(); |
|
|
UserStockJpModel::where(['user_id' => $userId, 'stock_id' => $stockId])->where('usable_num', ">=", $vipPrice)->dec('usable_num', $vipPrice)->update(); |
|
|
// 添加用户USD变更日志 |
|
|
// 添加用户USD变更日志 |
|
|
|
|
|
// UserStockLogModel::create([ |
|
|
UserStockJpLogModel::create([ |
|
|
UserStockJpLogModel::create([ |
|
|
'user_id' => $userId, |
|
|
'user_id' => $userId, |
|
|
'change_type' => 100, |
|
|
'change_type' => 100, |
|
@ -388,7 +385,7 @@ class UserService extends BaseHomeService |
|
|
'vip_type' => $vipType, |
|
|
'vip_type' => $vipType, |
|
|
]); |
|
|
]); |
|
|
}); |
|
|
}); |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful', []); |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
@ -411,12 +408,84 @@ class UserService extends BaseHomeService |
|
|
'total' => $list->total(), // 总记录数 |
|
|
'total' => $list->total(), // 总记录数 |
|
|
'last_page' => $list->lastPage(), // 最后一页页码 |
|
|
'last_page' => $list->lastPage(), // 最后一页页码 |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getLine(), $exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getLine(), $exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 使用vip兑换码兑换vip |
|
|
|
|
|
public function redeemVip($userId, $param) |
|
|
|
|
|
{ |
|
|
|
|
|
try { |
|
|
|
|
|
if (empty($param['vip_code'])) { |
|
|
|
|
|
return $this->toData('500', lang('missing param vip_code')); |
|
|
|
|
|
} |
|
|
|
|
|
$info = UserModel::where(['user_id' => $userId])->find(); |
|
|
|
|
|
if (empty($info)) { |
|
|
|
|
|
return $this->toData('500', lang('user_does_not_exist')); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取vip_code信息 |
|
|
|
|
|
$vipCodeInfo = VipCodeModel::where(['vip_code' => $param['vip_code']])->find(); |
|
|
|
|
|
if (empty($vipCodeInfo) || $vipCodeInfo->status != 0) { |
|
|
|
|
|
return $this->toData('500', lang('VIP引き換えコードが無効です')); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$expireTimestamp = strtotime('+' . $vipCodeInfo->day . ' day'); |
|
|
|
|
|
$expireTime = date("Y-m-d H:i:s", $expireTimestamp); |
|
|
|
|
|
// 查询用户是否开通过vip,更新用户vip到期时间 |
|
|
|
|
|
$vipLog = PurchaseVipModel::where(['user_id' => $userId])->find(); |
|
|
|
|
|
if (!empty($vipLog)) { |
|
|
|
|
|
if (empty($vipLog->expire)) { |
|
|
|
|
|
return $this->toData('500', lang('vip_expiration_time_error')); |
|
|
|
|
|
} |
|
|
|
|
|
if ($vipLog->expire >= date("Y-m-d H:i:s")) { |
|
|
|
|
|
$expireTimestamp = strtotime('+' . $vipCodeInfo->day . ' day', strtotime($vipLog->expire)); |
|
|
|
|
|
$expireTime = date("Y-m-d H:i:s", $expireTimestamp); |
|
|
|
|
|
} |
|
|
|
|
|
$vipLog->expire = $expireTime; |
|
|
|
|
|
$vipLog->save(); |
|
|
|
|
|
} else { |
|
|
|
|
|
PurchaseVipModel::create([ |
|
|
|
|
|
'user_id' => $userId, |
|
|
|
|
|
'expire' => $expireTime |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
// 修改vip兑换码使用状态 |
|
|
|
|
|
$vipCodeInfo->status = 1; |
|
|
|
|
|
$vipCodeInfo->uid = $userId; |
|
|
|
|
|
$vipCodeInfo->used_time = date("Y-m-d H:i:s"); |
|
|
|
|
|
$vipCodeInfo->save(); |
|
|
|
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
} catch (\Exception $exception) { |
|
|
|
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 观看视频记录 |
|
|
|
|
|
public function watchVideo($userId, $param) |
|
|
|
|
|
{ |
|
|
|
|
|
try { |
|
|
|
|
|
if (empty($param['video_id'])) { |
|
|
|
|
|
return $this->toData('500', lang('missing param')); |
|
|
|
|
|
} |
|
|
|
|
|
$info = UserModel::where(['user_id' => $userId])->find(); |
|
|
|
|
|
if (empty($info)) { |
|
|
|
|
|
return $this->toData('500', lang('user_does_not_exist')); |
|
|
|
|
|
} |
|
|
|
|
|
$exists = WatchVideoLogModel::where(['user_id' => $userId, 'video_id' => $param['video_id']])->find(); |
|
|
|
|
|
if (empty($exists)) { |
|
|
|
|
|
WatchVideoLogModel::create([ |
|
|
|
|
|
'user_id' => $userId, |
|
|
|
|
|
'video_id' => $param['video_id'], |
|
|
|
|
|
'created_at' => date("Y-m-d H:i:s") |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
} catch (\Exception $exception) { |
|
|
|
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 查询代理下的一个主播信息 |
|
|
// 查询代理下的一个主播信息 |
|
|
public function getAnchorForAgent($userId) |
|
|
public function getAnchorForAgent($userId) |
|
|
{ |
|
|
{ |
|
@ -589,14 +658,12 @@ class UserService extends BaseHomeService |
|
|
$chatFriendsUrl = env('CHAT_SERVER.BASE_URL') . '/api/user'; |
|
|
$chatFriendsUrl = env('CHAT_SERVER.BASE_URL') . '/api/user'; |
|
|
$chatFriendsRes = (new \app\utility\RequestChatServer())->ReqChatServer($chatFriendsUrl, $upChaData, 'PUT'); |
|
|
$chatFriendsRes = (new \app\utility\RequestChatServer())->ReqChatServer($chatFriendsUrl, $upChaData, 'PUT'); |
|
|
return $this->toData($chatFriendsRes['code'], $chatFriendsRes['msg'], [$chatFriendsRes['data']]); |
|
|
return $this->toData($chatFriendsRes['code'], $chatFriendsRes['msg'], [$chatFriendsRes['data']]); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
|
return $this->toData('500', $message); |
|
|
return $this->toData('500', $message); |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -840,7 +907,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -894,7 +960,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -902,7 +967,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -955,7 +1019,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -963,7 +1026,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1010,7 +1072,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1018,7 +1079,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1064,7 +1124,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1117,7 +1176,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1125,7 +1183,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1177,7 +1234,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1185,7 +1241,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1231,7 +1286,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1239,7 +1293,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1284,7 +1337,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1336,7 +1388,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1453,7 +1504,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1553,7 +1603,6 @@ class UserService extends BaseHomeService |
|
|
|
|
|
|
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful'); |
|
|
return $this->toData('0', 'successful'); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1575,7 +1624,6 @@ class UserService extends BaseHomeService |
|
|
$list = UserLoanModel::getUserLoanList($data); |
|
|
$list = UserLoanModel::getUserLoanList($data); |
|
|
// 返回结果 |
|
|
// 返回结果 |
|
|
return $this->toData('0', 'successful', $list); |
|
|
return $this->toData('0', 'successful', $list); |
|
|
|
|
|
|
|
|
} catch (ValidateException $validateException) { |
|
|
} catch (ValidateException $validateException) { |
|
|
// 参数校验失败 异常类 |
|
|
// 参数校验失败 异常类 |
|
|
$message = $validateException->getError(); |
|
|
$message = $validateException->getError(); |
|
@ -1600,7 +1648,6 @@ class UserService extends BaseHomeService |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1680,7 +1727,6 @@ class UserService extends BaseHomeService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $this->toData('0', 'Already submitted'); |
|
|
return $this->toData('0', 'Already submitted'); |
|
|
|
|
|
|
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
@ -1751,11 +1797,11 @@ class UserService extends BaseHomeService |
|
|
'frozen_num' => 0, |
|
|
'frozen_num' => 0, |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return $this->toData('0', 'success.', []); |
|
|
return $this->toData('0', 'success.', []); |
|
|
} |
|
|
} |
|
|
public function applyTestMoney($userId,$param){ |
|
|
public function applyTestMoney($userId, $param) |
|
|
|
|
|
{ |
|
|
if (empty($userId) || $userId <= 0) { |
|
|
if (empty($userId) || $userId <= 0) { |
|
|
return $this->toData('500', lang('please_log_in_first')); |
|
|
return $this->toData('500', lang('please_log_in_first')); |
|
|
} |
|
|
} |
|
@ -1869,6 +1915,7 @@ class UserService extends BaseHomeService |
|
|
'page_url' => $param['page_url'], |
|
|
'page_url' => $param['page_url'], |
|
|
'module' => $param['module'], |
|
|
'module' => $param['module'], |
|
|
'remark' => $param['remark'], |
|
|
'remark' => $param['remark'], |
|
|
|
|
|
'ip' => $param['ip'] ?? '', |
|
|
]); |
|
|
]); |
|
|
if (empty($userAccessLog)) { |
|
|
if (empty($userAccessLog)) { |
|
|
return $this->toData('500', lang('system_busy')); |
|
|
return $this->toData('500', lang('system_busy')); |
|
@ -1880,7 +1927,8 @@ class UserService extends BaseHomeService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 用户调用接口次数记录 |
|
|
// 用户调用接口次数记录 |
|
|
public function apiCalledRecord($userId, $param){ |
|
|
public function apiCalledRecord($userId, $param) |
|
|
|
|
|
{ |
|
|
try { |
|
|
try { |
|
|
if (empty($param['api_name'])) { |
|
|
if (empty($param['api_name'])) { |
|
|
return $this->toData('400', lang('parameter_error')); |
|
|
return $this->toData('400', lang('parameter_error')); |
|
|