58 lines
976 B
PHP
58 lines
976 B
PHP
<?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()
|
|
{
|
|
|
|
}
|
|
} |