Update Order.php

This commit is contained in:
邹景立 2021-03-24 18:10:40 +08:00
parent 00470fe6cd
commit 32b59400ce

View File

@ -199,8 +199,8 @@ class Order extends Auth
*/
public function discount()
{
$data = $this->_vali(['discount_id.require' => '折扣编号不能为空!']);
[$map, $rate] = [['status' => 1, 'deleted' => 0, 'id' => $data['discount_id']], 100.00];
$data = $this->_vali(['discount.require' => '折扣编号不能为空!']);
[$map, $rate] = [['status' => 1, 'deleted' => 0, 'id' => $data['discount']], 100.00];
if ($discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items')) {
foreach (json_decode($discount, true) as $vo) if ($vo['level'] == $this->user['vip_code']) {
$rate = round($vo['discount']);