feat : check
This commit is contained in:
58
app/Service/Amqp/Order/GoodOrderFinishSuccessorService.php
Normal file
58
app/Service/Amqp/Order/GoodOrderFinishSuccessorService.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Amqp\Order;
|
||||
|
||||
use App\Constants\Common\OrderCode;
|
||||
use App\Model\Order;
|
||||
use Exception;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
class GoodOrderFinishSuccessorService
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public int $orderId;
|
||||
|
||||
/**
|
||||
* @var Order
|
||||
*/
|
||||
#[Inject]
|
||||
protected Order $orderModel;
|
||||
|
||||
/**
|
||||
* @var Order
|
||||
*/
|
||||
protected Order $orderInfo;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->orderInfo = $this->orderModel->find($this->orderId);
|
||||
|
||||
if (empty($this->orderInfo)) throw new Exception('订单不存在');
|
||||
|
||||
if ($this->orderInfo->status != OrderCode::FINISH) throw new Exception('订单状态错误');
|
||||
|
||||
$this->addOrderPoint();
|
||||
|
||||
$this->addInvite();
|
||||
}
|
||||
|
||||
private function addOrderPoint()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function addInvite()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user