Update
parent
dd6aa228e1
commit
4f4d6a5115
|
|
@ -92,7 +92,11 @@ class DealerOrderController extends AdminController
|
|||
$actions->append(new DealerOrderPaid());
|
||||
}
|
||||
|
||||
if ($actions->row->isPay() && Admin::user()->can('dcat.admin.dealer_orders.refuse')) {
|
||||
if (
|
||||
$actions->row->isPay() &&
|
||||
$actions->row->isPayWayOffline() &&
|
||||
Admin::user()->can('dcat.admin.dealer_orders.refuse')
|
||||
) {
|
||||
$actions->append(new DealerOrderRefuse());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ class DealerOrderRefuse extends Form
|
|||
|
||||
$order = DealerOrder::lockForUpdate()->findOrFail($id);
|
||||
|
||||
if (! $order->isPayWayOffline()) {
|
||||
throw new BizException('订单付款方式不是线下打款');
|
||||
}
|
||||
|
||||
if (! $order->isPay()) {
|
||||
throw new BizException('无法收款:订单状态异常,请刷新后再试');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,6 +244,16 @@ class DealerOrder extends Model
|
|||
return $this->status == DealerOrderStatus::Cancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式是否是线下打款
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPayWayOffline(): bool
|
||||
{
|
||||
return $this->pay_way === static::PAY_WAY_OFFLINE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 能否操作
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue