'调整了一些bug'

This commit is contained in:
2020-08-21 15:45:30 +08:00
parent 1f2c1c0055
commit 60b1518028
16 changed files with 103 additions and 35 deletions

View File

@@ -32,6 +32,9 @@ class Init
//查询返回卡券信息
public $query_coupon;
//订单id
public $orderid;
//设置渠道
public function setUser($user)
{
@@ -40,6 +43,14 @@ class Init
return $this;
}
//设置渠道
public function setOrderId($orderid)
{
$this->orderid = $orderid;
return $this;
}
//设置核销码
public function setCode($redemptionCode)
{
@@ -125,13 +136,19 @@ class Init
//统一门店 相同金额 3分钟之内看作是一笔订单
public function CheckCount()
{
//排除本时生活渠道
$check_count = Coupon::where('outletId', $this->outletId)
->where('total', $this->total)
->where('status', 2)
->where('created_at', '>=', now()->subMinutes(3)->format('Y-m-d H:i:s'))
->count();
if ($this->orderid) {
$check_count = Coupon::where('orderid', $this->orderid)
->where('outletId', $this->outletId)
->where('status', 2)
->where('created_at', '>=', now()->subMinutes(3)->format('Y-m-d H:i:s'))
->count();
} else {
$check_count = Coupon::where('outletId', $this->outletId)
->where('total', $this->total)
->where('status', 2)
->where('created_at', '>=', now()->subMinutes(3)->format('Y-m-d H:i:s'))
->count();
}
$count = floor($this->total / 100);