feat : refund
This commit is contained in:
41
app/Service/Amqp/Refund/GoodOrderAllRefundService.php
Normal file
41
app/Service/Amqp/Refund/GoodOrderAllRefundService.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Amqp\Refund;
|
||||
|
||||
use App\Constants\Common\OrderCode;
|
||||
use App\Model\Order;
|
||||
use App\Model\PayOrder;
|
||||
use Exception;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
class GoodOrderAllRefundService extends RefundBaseService
|
||||
{
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->type = OrderCode::ORDER_TYPE_GOOD;
|
||||
}
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->getOrderInfo();
|
||||
|
||||
$this->getPayOrder();
|
||||
|
||||
$this->getRefundAmount();
|
||||
|
||||
if ($this->refundAmount <= 0) throw new Exception('退款金额不能小于等于0');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user