From 13616e80497f91b5ac7eb4ef7c5831e7c1dc2543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 11 Mar 2021 17:16:00 +0800 Subject: [PATCH] Update Order.php --- app/data/controller/api/auth/Order.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/data/controller/api/auth/Order.php b/app/data/controller/api/auth/Order.php index 59cdaab31..5f4204584 100644 --- a/app/data/controller/api/auth/Order.php +++ b/app/data/controller/api/auth/Order.php @@ -60,12 +60,12 @@ class Order extends Auth $order = ['uid' => $this->uuid]; $order['order_no'] = CodeExtend::uniqidDate(18, 'N'); // 推荐人处理 - $order['from'] = input('from_uid', $this->user['pid1']); - if ($order['from'] == $this->uuid) $order['from'] = 0; - if ($order['from'] > 0) { - $map = ['id' => $order['from'], 'status' => 1]; - $fromer = $this->app->db->name('DataUser')->where($map)->find(); - if (empty($fromer)) $this->error('推荐人异常'); + $order['puid1'] = input('puid1', $this->user['pid1']); + if ($order['puid1'] == $this->uuid) $order['puid1'] = 0; + if ($order['puid1'] > 0) { + $map = ['id' => $order['puid1'], 'status' => 1]; + $order['puid2'] = $this->app->db->name('DataUser')->where($map)->value('pid2'); + if (is_null($order['puid2'])) $this->error('推荐人异常'); } foreach (explode('||', $rules) as $rule) { [$code, $spec, $count] = explode('@', $rule);