121
This commit is contained in:
parent
e98e61c241
commit
bfa5e94f89
|
|
@ -795,7 +795,9 @@ class Login extends Base
|
||||||
// 获取设备信息
|
// 获取设备信息
|
||||||
$device = request()->param('device', ''); // 设备类型
|
$device = request()->param('device', ''); // 设备类型
|
||||||
$device_info = request()->param('device_info', ''); // 设备详细信息
|
$device_info = request()->param('device_info', ''); // 设备详细信息
|
||||||
|
if ($device == "") {
|
||||||
|
$device = request()->header('client');
|
||||||
|
}
|
||||||
// 获取IP和地理位置信息
|
// 获取IP和地理位置信息
|
||||||
$ip = $this->getRealIp();
|
$ip = $this->getRealIp();
|
||||||
$location = '';
|
$location = '';
|
||||||
|
|
@ -885,11 +887,11 @@ class Login extends Base
|
||||||
$redisKey = "VerificationCode:{$mobile}";
|
$redisKey = "VerificationCode:{$mobile}";
|
||||||
$redisCode = $redis->get($redisKey);
|
$redisCode = $redis->get($redisKey);
|
||||||
// if ($code != "9999") {
|
// if ($code != "9999") {
|
||||||
if (empty($redisCode) || $redisCode != $code) {
|
if (empty($redisCode) || $redisCode != $code) {
|
||||||
$logMessages[] = '验证码错误: ' . $code . ',正确验证码: ' . $redisCode;
|
$logMessages[] = '验证码错误: ' . $code . ',正确验证码: ' . $redisCode;
|
||||||
Log::error(end($logMessages));
|
Log::error(end($logMessages));
|
||||||
return $this->renderError('验证码错误');
|
return $this->renderError('验证码错误');
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 验证通过后删除Redis中的验证码
|
// 验证通过后删除Redis中的验证码
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,14 @@ class UserLoginLog extends Model
|
||||||
->where('login_time', '<=', $today_end)
|
->where('login_time', '<=', $today_end)
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
// 如果今天已记录,则不再记录
|
// 如果今天已记录,则更新最后登录时间
|
||||||
if ($exist) {
|
if ($exist) {
|
||||||
return false;
|
return self::where('id', $exist['id'])->update([
|
||||||
|
'last_login_time' => time(),
|
||||||
|
'device' => $device,
|
||||||
|
'ip' => $ip
|
||||||
|
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加登录记录
|
// 添加登录记录
|
||||||
|
|
@ -56,6 +61,7 @@ class UserLoginLog extends Model
|
||||||
'year' => date('Y'),
|
'year' => date('Y'),
|
||||||
'month' => date('m'),
|
'month' => date('m'),
|
||||||
'week' => date('W'),
|
'week' => date('W'),
|
||||||
|
'last_login_time' => time()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ class MiniProgramPlatform extends BasePlatform
|
||||||
*/
|
*/
|
||||||
public function pay(array $data): array
|
public function pay(array $data): array
|
||||||
{
|
{
|
||||||
$currentHour = (int)date('H');
|
$currentHour = (int) date('H');
|
||||||
$currentMinute = (int)date('i');
|
$currentMinute = (int) date('i');
|
||||||
$currentTime = $currentHour * 100 + $currentMinute;
|
$currentTime = $currentHour * 100 + $currentMinute;
|
||||||
|
|
||||||
if ($currentTime < 800 || $currentTime >= 2200) {
|
if ($currentTime < 800 || $currentTime >= 2200) {
|
||||||
|
|
@ -72,6 +72,11 @@ class MiniProgramPlatform extends BasePlatform
|
||||||
'msg' => '支付未开放,请在08:00-22:00范围内购买'
|
'msg' => '支付未开放,请在08:00-22:00范围内购买'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
return [
|
||||||
|
'status' => 0,
|
||||||
|
'data' => [],
|
||||||
|
'msg' => '小程序支付通道维护中,请联系客服下载app。'
|
||||||
|
];
|
||||||
$data += ['user' => null, 'price' => 0, 'title' => '', 'attach' => 'order_wxs', 'pre' => 'MH_'];
|
$data += ['user' => null, 'price' => 0, 'title' => '', 'attach' => 'order_wxs', 'pre' => 'MH_'];
|
||||||
[
|
[
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
|
|
@ -112,7 +117,10 @@ class MiniProgramPlatform extends BasePlatform
|
||||||
// 生成新的支付通知URL
|
// 生成新的支付通知URL
|
||||||
$notifyUrl = generatePayNotifyUrl($payment_type, $order_type, $user_id, $order_no, $callback_nonce_str);
|
$notifyUrl = generatePayNotifyUrl($payment_type, $order_type, $user_id, $order_no, $callback_nonce_str);
|
||||||
$is_test = $user['istest'];
|
$is_test = $user['istest'];
|
||||||
|
// $randomNumber = random_int(1, 10) / 100;
|
||||||
|
// if ($price > $randomNumber) {
|
||||||
|
// $price = $price - $randomNumber;
|
||||||
|
// }
|
||||||
// throw new \Exception('支付未开放');
|
// throw new \Exception('支付未开放');
|
||||||
// if ($is_test == 2) {
|
// if ($is_test == 2) {
|
||||||
// $price = 0.01;
|
// $price = 0.01;
|
||||||
|
|
@ -591,9 +599,11 @@ class MiniProgramPlatform extends BasePlatform
|
||||||
*/
|
*/
|
||||||
private function switchToAlternativeMerchant(): void
|
private function switchToAlternativeMerchant(): void
|
||||||
{
|
{
|
||||||
if (empty($this->mp_miniprogram) ||
|
if (
|
||||||
|
empty($this->mp_miniprogram) ||
|
||||||
empty($this->mp_miniprogram['merchants']) ||
|
empty($this->mp_miniprogram['merchants']) ||
|
||||||
!is_array($this->mp_miniprogram['merchants'])) {
|
!is_array($this->mp_miniprogram['merchants'])
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -614,9 +624,11 @@ class MiniProgramPlatform extends BasePlatform
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查商户是否被启用且在小程序配置中
|
// 检查商户是否被启用且在小程序配置中
|
||||||
if (isset($merchant['is_enabled'], $merchant['mch_id']) &&
|
if (
|
||||||
|
isset($merchant['is_enabled'], $merchant['mch_id']) &&
|
||||||
$merchant['is_enabled'] === "1" &&
|
$merchant['is_enabled'] === "1" &&
|
||||||
in_array($merchant['mch_id'], $this->mp_miniprogram['merchants'])) {
|
in_array($merchant['mch_id'], $this->mp_miniprogram['merchants'])
|
||||||
|
) {
|
||||||
|
|
||||||
// 检查商户是否被临时停用
|
// 检查商户是否被临时停用
|
||||||
$disable_key = 'merchant:payment:disabled:' . $merchant['mch_id'];
|
$disable_key = 'merchant:payment:disabled:' . $merchant['mch_id'];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user