Compare commits

..

No commits in common. "755cf15794bd16e5e46edddc878726d0d5e4153f" and "de52536a3725cea3853f6bd6e0978801fc88f41f" have entirely different histories.

5 changed files with 18 additions and 35 deletions

View File

@ -31,7 +31,7 @@ class WithdrawController
/** /**
* 手续费 * 手续费
*/ */
protected static $handlingFee = 0; protected static $handlingFee=0;
/** /**
* @Apidoc\Title("1.0 查询当前用户提现订单") * @Apidoc\Title("1.0 查询当前用户提现订单")
* @Apidoc\Url("api/withdraw/withdrawCashList") * @Apidoc\Url("api/withdraw/withdrawCashList")
@ -115,20 +115,9 @@ class WithdrawController
return ApiResponseApp::error(null, '每天只能提现三次'); return ApiResponseApp::error(null, '每天只能提现三次');
} }
$user = User::find($user_id); $user = User::find($user_id);
if ($money_no > $user->money) { if($money_no>$user->money){
return ApiResponseApp::error(null, '提现积分不足'); return ApiResponseApp::error(null, '提现积分不足');
} }
// 获取当前时间的 3 分钟前
$threeMinutesAgo = Carbon::now()->subMinutes(3);
// 使用 exists() 查询,判断是否有记录
if (Withdraw::where('user_id', $user_id)
->where('created_at', '>=', $threeMinutesAgo)
->exists()
) {
return ApiResponseApp::error(null, '提现频繁请三分钟后再试');
}
//提现金额 //提现金额
$rate = ExchangeRate::where('type', 'BDT')->get(); $rate = ExchangeRate::where('type', 'BDT')->get();
$money = (int)$money_no / 100 * $rate[0]['points']; $money = (int)$money_no / 100 * $rate[0]['points'];
@ -147,7 +136,7 @@ class WithdrawController
UserRewardDao::base($user_id, 1, - ($money_no + self::$handlingFee), '提现'); UserRewardDao::base($user_id, 1, - ($money_no + self::$handlingFee), '提现');
return ApiResponseApp::success(null, '等待管理员审核'); return ApiResponseApp::success(null, '等待管理员审核');
} }
//用户积分减少$money //用户积分减少$money
UserRewardDao::base($user_id, 1, - ($money_no + self::$handlingFee), '提现'); UserRewardDao::base($user_id, 1, - ($money_no + self::$handlingFee), '提现');
$userbank = Userbank::where('id', $bank_id)->first(); $userbank = Userbank::where('id', $bank_id)->first();
@ -164,36 +153,36 @@ class WithdrawController
return ApiResponseApp::success(null, '转账成功'); return ApiResponseApp::success(null, '转账成功');
} else { } else {
$errorMsg = ''; $errorMsg = '';
if ($res->ErrorMessage == "CheckIpAddressFailed") { if($res->ErrorMessage == "CheckIpAddressFailed"){
$errorMsg = 'IP 检查失败'; $errorMsg = 'IP 检查失败';
} }
if ($res->ErrorMessage == "CheckEncryptValueFailed ") { if($res->ErrorMessage == "CheckEncryptValueFailed "){
$errorMsg = '加密检查失败'; $errorMsg = '加密检查失败';
} }
if ($res->ErrorMessage == "PaymentChannelClosed") { if($res->ErrorMessage == "PaymentChannelClosed"){
$errorMsg = '平台休息中,暂不接单'; $errorMsg = '平台休息中,暂不接单';
} }
if ($res->ErrorMessage == "InsufficientBalance") { if($res->ErrorMessage == "InsufficientBalance"){
$errorMsg = '余额不足'; $errorMsg = '余额不足';
} }
if ($res->ErrorMessage == "TryAgainLater") { if($res->ErrorMessage == "TryAgainLater"){
$errorMsg = '系统忙碌中,请稍后再试'; $errorMsg = '系统忙碌中,请稍后再试';
} }
if ($res->ErrorMessage == "DevError") { if($res->ErrorMessage == "DevError"){
$errorMsg = '程式错误,请联络开发人员'; $errorMsg = '程式错误,请联络开发人员';
} }
if ($res->ErrorMessage == "PayeeAccountNameFormatError") { if($res->ErrorMessage == "PayeeAccountNameFormatError"){
$errorMsg = '收款人帐号格式错误'; $errorMsg = '收款人帐号格式错误';
} }
if ($res->ErrorMessage == "PayeeAccountNumberFormatError") { if($res->ErrorMessage == "PayeeAccountNumberFormatError"){
$errorMsg = '收款人卡号格式错误'; $errorMsg = '收款人卡号格式错误';
} }
if ($errorMsg == '') { if($errorMsg == ''){
$errorMsg = '未知错误'; $errorMsg = '未知错误';
} }
$withdraw->update([ $withdraw->update([
'status' => 5, // 'status' => 5, //
'status_text' => trans('支付错误:') . $res->ErrorMessage 'status_text' => trans('支付错误:').$res->ErrorMessage
]); ]);
UserRewardDao::base($user_id, 1, $money_no + self::$handlingFee, '提现失败返还'); UserRewardDao::base($user_id, 1, $money_no + self::$handlingFee, '提现失败返还');
// if ($res->ErrorMessage == "PayeeAccountNameFormatError") { // if ($res->ErrorMessage == "PayeeAccountNameFormatError") {
@ -221,7 +210,7 @@ class WithdrawController
$withdraw = Withdraw::where('order_number', $orderId)->first(); $withdraw = Withdraw::where('order_number', $orderId)->first();
//$failedMessage为null就是成功 //$failedMessage为null就是成功
if ($failedMessage != null) { if ($failedMessage != null) {
if ($withdraw->status == 5) { if($withdraw->status == 5){
return; return;
} }
$rate = ExchangeRate::where('type', 'BDT')->get(); $rate = ExchangeRate::where('type', 'BDT')->get();

View File

@ -10,7 +10,6 @@ use support\Model;
* @property string $updated_at 更新时间 * @property string $updated_at 更新时间
* @property string $key key * @property string $key key
* @property string $value value * @property string $value value
* @property string $remark remark 备注
*/ */
class Dictionary extends Model class Dictionary extends Model
{ {

View File

@ -6,7 +6,6 @@ use app\dao\UserPhoneLogDao;
use App\Utils\API\SendCode; use App\Utils\API\SendCode;
use app\model\UserPhone; use app\model\UserPhone;
use app\dao\UserRewardDao; use app\dao\UserRewardDao;
use app\model\Dictionary;
use support\Log; use support\Log;
use Workerman\Crontab\Crontab; use Workerman\Crontab\Crontab;
use GuzzleHttp\Client; use GuzzleHttp\Client;
@ -23,8 +22,6 @@ class Task2
new Crontab('0 */1 * * * *', function () { new Crontab('0 */1 * * * *', function () {
$start_time = time(); $start_time = time();
Rocketgo::test_login(); Rocketgo::test_login();
//查询系统配置 是否自动删除用户
$autodelete=Dictionary::where('key','autodelete')->first();
Log::info("查询任务开始"); Log::info("查询任务开始");
// 获取账号列表 // 获取账号列表
$res = Rocketgo::account_list(); $res = Rocketgo::account_list();
@ -47,7 +44,7 @@ class Task2
$updateData = []; $updateData = [];
foreach ($res as $v) { foreach ($res as $v) {
if ($v['failedReason'] !== null && $autodelete->value=='1') { if ($v['failedReason'] !== null) {
SendCode::delWS($v['username']); SendCode::delWS($v['username']);
continue; continue;
} }

View File

@ -28,6 +28,5 @@ return [
'支付错误:'=>'Payment error:', '支付错误:'=>'Payment error:',
'等待银行打款'=>'Waiting for bank transfer', '等待银行打款'=>'Waiting for bank transfer',
'已到账'=>'Already arrived', '已到账'=>'Already arrived',
'提现'=>'Withdraw cash', '提现'=>'Withdraw cash'
'提现频繁请三分钟后再试'=>'Frequent withdrawals, please try again after three minutes'
]; ];

View File

@ -28,6 +28,5 @@ return [
'支付错误:'=>'支付错误:', '支付错误:'=>'支付错误:',
'等待银行打款'=>'等待银行打款', '等待银行打款'=>'等待银行打款',
'已到账'=>'已到账', '已到账'=>'已到账',
'提现'=>'提现', '提现'=>'提现'
'提现频繁请三分钟后再试'=>'提现频繁请三分钟后再试'
]; ];