增加来源
This commit is contained in:
9
bootstrap/cache/events.php
vendored
Normal file
9
bootstrap/cache/events.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php return array (
|
||||
'App\\Providers\\EventServiceProvider' =>
|
||||
array (
|
||||
'App\\Events\\ConponCallback' =>
|
||||
array (
|
||||
0 => 'App\\Listeners\\ConponCallbackListener',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -35,6 +35,9 @@ class Init
|
||||
//订单id
|
||||
public $orderid;
|
||||
|
||||
//来源
|
||||
public $from;
|
||||
|
||||
//查询到的卡券规则和商品id 只有平安券才有
|
||||
public $queryData;
|
||||
|
||||
@@ -99,6 +102,15 @@ class Init
|
||||
|
||||
}
|
||||
|
||||
//设置来源
|
||||
public function setFrom($from)
|
||||
{
|
||||
$this->from = $from;
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 插入日志
|
||||
* @Author: 玄尘
|
||||
@@ -139,6 +151,10 @@ class Init
|
||||
//统一门店 相同金额 3分钟之内看作是一笔订单
|
||||
public function CheckCount()
|
||||
{
|
||||
if (!empty($this->from) && in_array($this->from, [''])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->queryData) {
|
||||
if (isset($this->queryData['thirdPartyGoodsId']) && $this->queryData['thirdPartyGoodsId'] == 'YSD-full0-0') {
|
||||
return true;
|
||||
|
||||
@@ -117,9 +117,17 @@ class Coupon
|
||||
* @param float $total 订单金额
|
||||
* @param string $outletId 网点id
|
||||
* @param string $orderid 订单id
|
||||
* @param string $from 来源
|
||||
* @return string
|
||||
*/
|
||||
public static function Redemption(User $user, string $redemptionCode, float $total, string $outletId, string $orderid = '')
|
||||
public static function Redemption(
|
||||
User $user,
|
||||
string $redemptionCode,
|
||||
float $total,
|
||||
string $outletId,
|
||||
string $orderid = '',
|
||||
string $from = ''
|
||||
)
|
||||
{
|
||||
|
||||
try {
|
||||
@@ -133,6 +141,7 @@ class Coupon
|
||||
->setTotal($total)
|
||||
->setOutletId($outletId)
|
||||
->setOrderId($orderid)
|
||||
->setFrom($from)
|
||||
->start();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user