修改平台购物卡发放的错误
This commit is contained in:
parent
ffb34f0017
commit
65690c80dc
@ -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 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -363,8 +363,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
}
|
||||
|
||||
//判断是否是平台购物卡
|
||||
$merchantCate = $order->orderProduct[0]->product->merCateId;
|
||||
if (!empty($merchantCate) && in_array(env('PLATFORM_CARD_CATE_ID'), array_column($merchantCate->toArray(), 'mer_cate_id'))) {
|
||||
if ($order->orderProduct[0]->product->isPlatformCard()) {
|
||||
//购物卡自动发货
|
||||
$deliveryData = [
|
||||
'delivery_type' => 3,
|
||||
|
@ -68,7 +68,7 @@ class OrderOther extends BaseController
|
||||
}
|
||||
$where['paid']=1;
|
||||
if($where['source']<=0){
|
||||
$where['source']=105;
|
||||
$where['source']=12;
|
||||
}
|
||||
return app('json')->success($this->repository->merchantGetList($where, $page, $limit));
|
||||
}
|
||||
|
@ -16,8 +16,7 @@ class OrderDeliveryListen implements ListenerInterface
|
||||
{
|
||||
$order = $event['order'];
|
||||
foreach ($order->orderProduct as $orderProduct) {
|
||||
$merchantCate = $orderProduct->product->merCateId;
|
||||
if (empty($merchantCate) || $merchantCate[0]['mer_cate_id'] != env('PLATFORM_CARD_CATE_ID')) {
|
||||
if (!$orderProduct->product->isPlatformCard()) {
|
||||
continue;
|
||||
}
|
||||
$consumption = StoreConsumption::where('type', StoreConsumption::TYPE_PULL_CONSUMPTION)->find();
|
||||
|
Loading…
x
Reference in New Issue
Block a user