修改差额奖

This commit is contained in:
邹景立 2021-10-30 14:28:39 +08:00
parent a461fad00a
commit f846af063d

View File

@ -273,7 +273,7 @@ class RebateService extends Service
if (empty($vips) || empty($users)) return true; if (empty($vips) || empty($users)) return true;
// 查询需要计算奖励的商品 // 查询需要计算奖励的商品
foreach (ShopOrderItem::mk()->where(['order_no' => $this->order['order_no']])->cursor() as $item) { foreach (ShopOrderItem::mk()->where(['order_no' => $this->order['order_no']])->cursor() as $item) {
if ($item['discount_id'] > 0) { if ($item['discount_id'] > 0 && $item['rebate_type'] === 1) {
[$tVip, $tRate] = [$item['vip_code'], $item['discount_rate']]; [$tVip, $tRate] = [$item['vip_code'], $item['discount_rate']];
$map = ['id' => $item['discount_id'], 'status' => 1, 'deleted' => 0]; $map = ['id' => $item['discount_id'], 'status' => 1, 'deleted' => 0];
$rules = json_decode(BaseUserDiscount::mk()->where($map)->value('items', '[]'), true); $rules = json_decode(BaseUserDiscount::mk()->where($map)->value('items', '[]'), true);