WIP
parent
99c9b1f88e
commit
1894cd78bd
|
|
@ -97,7 +97,13 @@ class OrderRefundCommand extends Command
|
|||
{
|
||||
$order = $log->order;
|
||||
|
||||
(new WalletService())->changeBalance($order->user, $order->total_amount, WalletLog::ACTION_ORDER_CANCELLED, '订单-取消', $order);
|
||||
(new WalletService())->changeBalance(
|
||||
$order->user,
|
||||
$order->total_amount,
|
||||
$log->after_sale_id ? WalletLog::ACTION_ORDER_AFTER_SALE : WalletLog::ACTION_ORDER_CANCELLED,
|
||||
$log->after_sale_id ? '订单-售后退款' : $log->reason,
|
||||
$order
|
||||
);
|
||||
|
||||
$log->update([
|
||||
'status' => OrderRefundLog::STATUS_SUCCESS,
|
||||
|
|
@ -115,7 +121,13 @@ class OrderRefundCommand extends Command
|
|||
{
|
||||
$order = $log->order;
|
||||
|
||||
(new BalanceService())->changeBalance($order->user, $order->total_amount, BalanceLog::ACTION_ORDER_CANCELLED, '订单-取消', $order);
|
||||
(new BalanceService())->changeBalance(
|
||||
$order->user,
|
||||
$order->total_amount,
|
||||
$log->after_sale_id ? BalanceLog::ACTION_ORDER_AFTER_SALE : BalanceLog::ACTION_ORDER_CANCELLED,
|
||||
$log->after_sale_id ? '订单-售后退款' : $log->reason,
|
||||
$order
|
||||
);
|
||||
|
||||
$log->update([
|
||||
'status' => OrderRefundLog::STATUS_SUCCESS,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class BalanceLog extends Model
|
||||
{
|
||||
public const ACTION_ORDER_PAID = 1;
|
||||
public const ACTION_ORDER_CANCELLED = 1;
|
||||
public const ACTION_ORDER_CANCELLED = 2;
|
||||
public const ACTION_ORDER_AFTER_SALE = 3;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class WalletLog extends Model
|
||||
{
|
||||
public const ACTION_ORDER_PAID = 1;
|
||||
public const ACTION_ORDER_CANCELLED = 1;
|
||||
public const ACTION_ORDER_CANCELLED = 2;
|
||||
public const ACTION_ORDER_AFTER_SALE = 3;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
|
|||
Loading…
Reference in New Issue