mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +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
|
||||
{
|
||||
[$map, $rate] = ['id' => $disId, ['status' => 1, 'deleted' => 0], 100.00];
|
||||
if ($discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items')) {
|
||||
foreach (json_decode($discount, true) as $vo) if ($vo['level'] == $vipCode) {
|
||||
$rate = round($vo['discount']);
|
||||
}
|
||||
if ($disId > 0 && ($discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items'))) {
|
||||
foreach (json_decode($discount, true) as $vo) if ($vo['level'] == $vipCode) $rate = round($vo['discount']);
|
||||
}
|
||||
return [$disId, $rate];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user