|
@@ -9,6 +9,7 @@ use SixShop\WechatPay\Event\TransferBillFailedEvent;
|
|
|
use think\facade\Db;
|
|
use think\facade\Db;
|
|
|
use think\facade\Event;
|
|
use think\facade\Event;
|
|
|
use think\Paginator;
|
|
use think\Paginator;
|
|
|
|
|
+use function SixShop\Core\throw_logic_exception;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @mixin \SixShop\WechatPay\Model\WechatpayTransferBillModel
|
|
* @mixin \SixShop\WechatPay\Model\WechatpayTransferBillModel
|
|
@@ -45,6 +46,9 @@ class WechatpayTransferBillEntity extends BaseEntity
|
|
|
if ($transferBill->isEmpty()) {
|
|
if ($transferBill->isEmpty()) {
|
|
|
throw new Exception('提现单不存在');
|
|
throw new Exception('提现单不存在');
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($transferBill->state !== TransferBillStatusEnum::APPLYING) {
|
|
|
|
|
+ throw_logic_exception('非法操作');
|
|
|
|
|
+ }
|
|
|
$transferBill->state = TransferBillStatusEnum::FAIL;
|
|
$transferBill->state = TransferBillStatusEnum::FAIL;
|
|
|
$transferBill->fail_reason = $failReason;
|
|
$transferBill->fail_reason = $failReason;
|
|
|
Db::transaction(function () use ($transferBill) {
|
|
Db::transaction(function () use ($transferBill) {
|