调整购物卡使用限制
This commit is contained in:
parent
4e7d87c9cf
commit
9de3c1bde1
@ -84,10 +84,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$activityProductCount = 0;
|
$activityProductCount = 0;
|
||||||
//判断是否是平台购物卡,购物卡不允许使用任何优惠券
|
//判断是否是平台购物卡,购物卡不允许使用任何优惠券
|
||||||
$merchantCate = $merchantCartList[0]['list'][0]->product->merCateId;
|
$merchantCate = $merchantCartList[0]['list'][0]->product->merCateId;
|
||||||
$isPlatformCard = false;
|
$isPlatformCard = $merchantCart['list'][0]['product']->isPlatformCard();
|
||||||
if (!empty($merchantCate) && in_array(env('PLATFORM_CARD_CATE_ID'), array_column($merchantCate->toArray(), 'mer_cate_id'))) {
|
|
||||||
$isPlatformCard = true;
|
|
||||||
}
|
|
||||||
if ($isPlatformCard) {
|
if ($isPlatformCard) {
|
||||||
$merchantTypeId = Merchant::where('uid', $uid)->value('type_id');
|
$merchantTypeId = Merchant::where('uid', $uid)->value('type_id');
|
||||||
if (empty($merchantTypeId) || $merchantTypeId != 21) {
|
if (empty($merchantTypeId) || $merchantTypeId != 21) {
|
||||||
@ -552,12 +549,16 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
'is_fail' => 0
|
'is_fail' => 0
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($isPlatformCard) {
|
||||||
|
$platformConsumption = [];
|
||||||
|
} else {
|
||||||
$platformConsumption = Db::name('store_consumption_user')->where($ConsumptionWhere)->limit(100)->order('create_time', 'desc')
|
$platformConsumption = Db::name('store_consumption_user')->where($ConsumptionWhere)->limit(100)->order('create_time', 'desc')
|
||||||
->field('coupon_user_id,uid,coupon_title,coupon_price,balance,start_time,end_time')
|
->field('coupon_user_id,uid,coupon_title,coupon_price,balance,start_time,end_time')
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
$item['describe'] = '仅限平台指定商家商品可使用';
|
$item['describe'] = '仅限平台指定商家商品可使用';
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$usePlatformCouponId = 0;
|
$usePlatformCouponId = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user