From b039055bdb520c94147a1e09acec85fbaa6660c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 15 Mar 2021 18:30:17 +0800 Subject: [PATCH] Update UserRebate.php --- app/data/controller/UserRebate.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/data/controller/UserRebate.php b/app/data/controller/UserRebate.php index 25dbbad6a..66d62c031 100644 --- a/app/data/controller/UserRebate.php +++ b/app/data/controller/UserRebate.php @@ -54,13 +54,13 @@ class UserRebate extends Controller protected function _index_page_filter(array &$data) { $uids = array_merge(array_column($data, 'uid'), array_column($data, 'order_uid')); - $userList = $this->app->db->name('DataUser')->whereIn('id', array_unique($uids))->select(); - $goodsList = $this->app->db->name('ShopOrderItem')->whereIn('order_no', array_unique(array_column($data, 'order_no')))->select(); + $userItem = $this->app->db->name('DataUser')->whereIn('id', array_unique($uids))->select(); + $goodsItem = $this->app->db->name('ShopOrderItem')->whereIn('order_no', array_unique(array_column($data, 'order_no')))->select(); foreach ($data as &$vo) { [$vo['user'], $vo['agent'], $vo['list']] = [[], [], []]; - foreach ($userList as $user) if ($user['id'] === $vo['uid']) $vo['agent'] = $user; - foreach ($userList as $user) if ($user['id'] === $vo['order_uid']) $vo['user'] = $user; - foreach ($goodsList as $goods) if ($goods['order_no'] === $vo['order_no']) $vo['list'][] = $goods; + foreach ($userItem as $user) if ($user['id'] === $vo['uid']) $vo['agent'] = $user; + foreach ($userItem as $user) if ($user['id'] === $vo['order_uid']) $vo['user'] = $user; + foreach ($goodsItem as $goods) if ($goods['order_no'] === $vo['order_no']) $vo['list'][] = $goods; } }