|
|
|
@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
namespace App\Service; |
|
|
|
|
|
|
|
use App\Commons\Log; |
|
|
|
use App\Constants\LogLabel; |
|
|
|
use App\Model\Coupon; |
|
|
|
use App\Model\CouponUserRec; |
|
|
|
use App\Model\CouponUserUse; |
|
|
|
@ -19,6 +21,11 @@ use Hyperf\Di\Annotation\Inject; |
|
|
|
|
|
|
|
class OrderService implements OrderServiceInterface |
|
|
|
{ |
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var Log |
|
|
|
*/ |
|
|
|
protected $log; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
@ -333,6 +340,11 @@ class OrderService implements OrderServiceInterface |
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
|
|
|
$this->log->event( |
|
|
|
LogLabel::ORDER_LOG, |
|
|
|
$e->getMessage() |
|
|
|
); |
|
|
|
|
|
|
|
Db::rollBack(); |
|
|
|
return $e->getMessage(); |
|
|
|
|
|
|
|
@ -444,6 +456,10 @@ class OrderService implements OrderServiceInterface |
|
|
|
Db::commit(); |
|
|
|
return $orderMainId; |
|
|
|
} catch (Exception $e) { |
|
|
|
$this->log->event( |
|
|
|
LogLabel::ORDER_LOG, |
|
|
|
$e->getMessage() |
|
|
|
); |
|
|
|
Db::rollBack(); |
|
|
|
return '购买失败'; |
|
|
|
} |
|
|
|
|