feat : coupon
This commit is contained in:
22
app/Service/Admin/Order/OrderInfoService.php
Normal file
22
app/Service/Admin/Order/OrderInfoService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Order;
|
||||
|
||||
use App\Service\Admin\BaseService;
|
||||
|
||||
class OrderInfoService extends BaseService
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
//todo Write logic
|
||||
return $this->return->success();
|
||||
}
|
||||
}
|
||||
22
app/Service/Admin/Order/OrderListService.php
Normal file
22
app/Service/Admin/Order/OrderListService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Order;
|
||||
|
||||
use App\Service\Admin\BaseService;
|
||||
|
||||
class OrderListService extends BaseService
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
//todo Write logic
|
||||
return $this->return->success();
|
||||
}
|
||||
}
|
||||
83
app/Service/Admin/Order/RefundService.php
Normal file
83
app/Service/Admin/Order/RefundService.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Order;
|
||||
|
||||
use App\Constants\Common\RefundCode;
|
||||
use App\Exception\ErrException;
|
||||
use App\Service\Admin\BaseService;
|
||||
use App\Service\Amqp\Refund\FullRefundOrderService;
|
||||
use App\Service\Amqp\Refund\PartialRefundOrderService;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class RefundService extends BaseService
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): array
|
||||
{
|
||||
try {
|
||||
$orderId = (int)$this->request->input('order_id');
|
||||
|
||||
$service = new FullRefundOrderService();
|
||||
$service->orderId = $orderId;
|
||||
$service->reason = $this->request->input('reason','');
|
||||
$service->type = RefundCode::FULL_GOOD_REFUND;
|
||||
|
||||
$service->handle();
|
||||
|
||||
return $this->return->success();
|
||||
}catch (Exception $e) {
|
||||
throw new ErrException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function refundPartial(): array
|
||||
{
|
||||
try {
|
||||
$orderId = (int)$this->request->input('order_id');
|
||||
$orderGoodIds = $this->request->input('order_good_ids');
|
||||
if (empty($orderGoodIds)) throw new ErrException('请选择商品再退款');
|
||||
|
||||
$service = new PartialRefundOrderService();
|
||||
$service->orderId = $orderId;
|
||||
$service->reason = $this->request->input('reason','');
|
||||
$service->orderGoodIds = $orderGoodIds;
|
||||
$service->type = RefundCode::PARTIAL_GOOD_REFUND;
|
||||
|
||||
$service->handle();
|
||||
|
||||
return $this->return->success();
|
||||
}catch (Exception $e) {
|
||||
throw new ErrException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function refundBatch(): array
|
||||
{
|
||||
$siteId = $this->request->input('site_id');
|
||||
$cycleId = (int)$this->request->input('cycle_id');
|
||||
|
||||
return $this->return->success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user