6
0
Fork 0
release
李静 2021-12-28 13:09:42 +08:00
parent 99c9b1f88e
commit 1894cd78bd
3 changed files with 18 additions and 4 deletions

View File

@ -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,

View File

@ -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

View File

@ -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