mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-23 09:50:25 +08:00
Update OrderService.php
This commit is contained in:
parent
04e87bdb79
commit
6b9a75f4e7
@ -104,10 +104,8 @@ class OrderService extends Service
|
|||||||
public function discount(int $disId, int $vipCode): array
|
public function discount(int $disId, int $vipCode): array
|
||||||
{
|
{
|
||||||
[$map, $rate] = ['id' => $disId, ['status' => 1, 'deleted' => 0], 100.00];
|
[$map, $rate] = ['id' => $disId, ['status' => 1, 'deleted' => 0], 100.00];
|
||||||
if ($discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items')) {
|
if ($disId > 0 && ($discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items'))) {
|
||||||
foreach (json_decode($discount, true) as $vo) if ($vo['level'] == $vipCode) {
|
foreach (json_decode($discount, true) as $vo) if ($vo['level'] == $vipCode) $rate = round($vo['discount']);
|
||||||
$rate = round($vo['discount']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return [$disId, $rate];
|
return [$disId, $rate];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user