Merge branch 'offline_pay' into dev
# Conflicts: # crmeb/listens/OrderDeliveryListen.php
This commit is contained in:
commit
e2b23b9012
@ -589,4 +589,16 @@ class Product extends BaseModel
|
|||||||
return $this->mer_status == 1 && $this->status == 1 && $this->is_del == 0 && $this->is_show == self::IS_SHOW && $this->is_used == 1;
|
return $this->mer_status == 1 && $this->status == 1 && $this->is_del == 0 && $this->is_show == self::IS_SHOW && $this->is_used == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为平台卡商品
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isPlatformCard()
|
||||||
|
{
|
||||||
|
if (!empty($this->merCateId) && in_array(env('PLATFORM_CARD_CATE_ID'), array_column($this->merCateId->toArray(), 'mer_cate_id'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -366,8 +366,7 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
$this->autoPrinter($order->order_id, $order->mer_id);
|
$this->autoPrinter($order->order_id, $order->mer_id);
|
||||||
|
|
||||||
//判断是否是平台购物卡
|
//判断是否是平台购物卡
|
||||||
$merchantCate = $order->orderProduct[0]->product->merCateId;
|
if ($order->orderProduct[0]->product->isPlatformCard()) {
|
||||||
if (!empty($merchantCate) && in_array(env('PLATFORM_CARD_CATE_ID'), array_column($merchantCate->toArray(), 'mer_cate_id'))) {
|
|
||||||
//购物卡自动发货
|
//购物卡自动发货
|
||||||
$deliveryData = [
|
$deliveryData = [
|
||||||
'delivery_type' => 3,
|
'delivery_type' => 3,
|
||||||
|
@ -16,8 +16,7 @@ class OrderDeliveryListen implements ListenerInterface
|
|||||||
{
|
{
|
||||||
$order = $event['order'];
|
$order = $event['order'];
|
||||||
foreach ($order->orderProduct as $orderProduct) {
|
foreach ($order->orderProduct as $orderProduct) {
|
||||||
$merchantCate = $orderProduct->product->merCateId->toArray();
|
if (!$orderProduct->product->isPlatformCard()) {
|
||||||
if (empty($merchantCate) || $merchantCate[0]['mer_cate_id'] != env('PLATFORM_CARD_CATE_ID')) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$consumption = StoreConsumption::where('type', StoreConsumption::TYPE_PULL_CONSUMPTION)->find();
|
$consumption = StoreConsumption::where('type', StoreConsumption::TYPE_PULL_CONSUMPTION)->find();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user