Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

master
Lemon 5 years ago
parent
commit
666ef2446b
  1. 2
      app/Service/v3/Implementations/GoodsActivityService.php
  2. 5
      app/Service/v3/Implementations/GoodsService.php
  3. 16
      app/Service/v3/Implementations/PaymentService.php

2
app/Service/v3/Implementations/GoodsActivityService.php

@ -48,7 +48,7 @@ class GoodsActivityService implements GoodsActivityServiceInterface
} }
// 是否超过限购数量 // 是否超过限购数量
if ($goods->restrict_num < $num) {
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {
return ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT; return ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT;
} }

5
app/Service/v3/Implementations/GoodsService.php

@ -37,6 +37,11 @@ class GoodsService implements GoodsServiceInterface
return ErrorCode::GOODS_INVENTORY_ERROR; return ErrorCode::GOODS_INVENTORY_ERROR;
} }
// 是否超过限购数量
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {
return ErrorCode::GOODS_RESTRICT_LIMIT;
}
return true; return true;
} }

16
app/Service/v3/Implementations/PaymentService.php

@ -189,10 +189,10 @@ class PaymentService implements PaymentServiceInterface
// 如果是商户余额不足等原因,要发送短信给老总 // 如果是商户余额不足等原因,要发送短信给老总
$arr = ['NOTENOUGH','AMOUNT_LIMIT','NO_AUTH']; $arr = ['NOTENOUGH','AMOUNT_LIMIT','NO_AUTH'];
if (in_array($result['error_code'], $arr)) {
if (in_array($result['err_code'], $arr)) {
$redis = ApplicationContext::getContainer()->get(Redis::class); $redis = ApplicationContext::getContainer()->get(Redis::class);
if (!$redis->exists('send_withdraw_refuse_reson_'.date('Ymd'))) { if (!$redis->exists('send_withdraw_refuse_reson_'.date('Ymd'))) {
$this->smsAliSendService->doWithdrawFail($result['error_code'], $result['error_code_des']);
$this->smsAliSendService->doWithdrawFail($result['err_code'], $result['err_code_des']);
} }
} }
@ -204,17 +204,17 @@ class PaymentService implements PaymentServiceInterface
$arr = ['NAME_MISMATCH','V2_ACCOUNT_SIMPLE_BAN', 'SENDNUM_LIMIT']; $arr = ['NAME_MISMATCH','V2_ACCOUNT_SIMPLE_BAN', 'SENDNUM_LIMIT'];
$msg = ''; $msg = '';
if (in_array($result['error_code'], $arr)) {
$msg = $result['error_code_des'];
if (in_array($result['err_code'], $arr)) {
$msg = $result['err_code_des'];
} }
if ($result['error_code'] == 'SENDNUM_LIMIT') {
if ($result['err_code'] == 'SENDNUM_LIMIT') {
throw new ErrorCodeException(ErrorCode::PAYMENT_SEND_NUM_LIMIT); throw new ErrorCodeException(ErrorCode::PAYMENT_SEND_NUM_LIMIT);
} elseif ($result['error_code'] == 'V2_ACCOUNT_SIMPLE_BAN') {
} elseif ($result['err_code'] == 'V2_ACCOUNT_SIMPLE_BAN') {
throw new ErrorCodeException(ErrorCode::PAYMENT_V2_ACCOUNT_SIMPLE_BAN); throw new ErrorCodeException(ErrorCode::PAYMENT_V2_ACCOUNT_SIMPLE_BAN);
} elseif ($result['error_code'] == 'NAME_MISMATCH') {
} elseif ($result['err_code'] == 'NAME_MISMATCH') {
throw new ErrorCodeException(ErrorCode::PAYMENT_NAME_MISMATCH); throw new ErrorCodeException(ErrorCode::PAYMENT_NAME_MISMATCH);
} elseif ($result['error_code'] == 'AMOUNT_LIMIT') {
} elseif ($result['err_code'] == 'AMOUNT_LIMIT') {
throw new ErrorCodeException(ErrorCode::PAYMENT_AMOUNT_LIMIT); throw new ErrorCodeException(ErrorCode::PAYMENT_AMOUNT_LIMIT);
} }

Loading…
Cancel
Save