From 1bae2d5dc6b8edd0405d27584941a0699d90cc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Tue, 11 Jun 2024 23:00:52 +0800 Subject: [PATCH 1/3] 1 --- app/store/controller/Merchant.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index 4f3c86aa..e666a629 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -55,16 +55,27 @@ class Merchant extends Controller continue; } - if (!empty($l['user_name'])) { - array_push($list, $l['user_name']); + + if (!empty($l['user_id']) && !empty($l['user_name'])) { + $tmp = [ + $l['user_id'] => $l['user_name'] + ]; + array_push($list, $tmp); } } $model2 = new MerchantModel; $list2 = $model2->getList($this->request->param())->toArray(); - $userIds = array_column($list2['data'], "user_name"); + $userIds = array_column($list2['data'], "user_id"); + + + foreach ($list as $kd => $d) { + if (in_array($kd, $userIds)) { + unset($list[$kd]); + } + } - $list = array_diff($list, $userIds); + //$list = array_diff($list, $userIds); return $this->renderSuccess(compact('list')); } From d454e6ef8642ec5e09beec883bf8b4aaa8e6dca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Tue, 11 Jun 2024 23:06:59 +0800 Subject: [PATCH 2/3] trac --- app/store/controller/Merchant.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index e666a629..cb0d924e 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -55,10 +55,9 @@ class Merchant extends Controller continue; } - - if (!empty($l['user_id']) && !empty($l['user_name'])) { + if (!empty($l['store_user_id']) && !empty($l['user_name'])) { $tmp = [ - $l['user_id'] => $l['user_name'] + $l['store_user_id'] => $l['user_name'] ]; array_push($list, $tmp); } @@ -66,7 +65,7 @@ class Merchant extends Controller $model2 = new MerchantModel; $list2 = $model2->getList($this->request->param())->toArray(); - $userIds = array_column($list2['data'], "user_id"); + $userIds = array_column($list2['data'], "user_name"); foreach ($list as $kd => $d) { From 96318bacd7c3569e51f3ad7e3b1e5e4539561635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Tue, 11 Jun 2024 23:14:51 +0800 Subject: [PATCH 3/3] revert --- app/store/controller/Merchant.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index cb0d924e..4f3c86aa 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -55,11 +55,8 @@ class Merchant extends Controller continue; } - if (!empty($l['store_user_id']) && !empty($l['user_name'])) { - $tmp = [ - $l['store_user_id'] => $l['user_name'] - ]; - array_push($list, $tmp); + if (!empty($l['user_name'])) { + array_push($list, $l['user_name']); } } @@ -67,14 +64,7 @@ class Merchant extends Controller $list2 = $model2->getList($this->request->param())->toArray(); $userIds = array_column($list2['data'], "user_name"); - - foreach ($list as $kd => $d) { - if (in_array($kd, $userIds)) { - unset($list[$kd]); - } - } - - //$list = array_diff($list, $userIds); + $list = array_diff($list, $userIds); return $this->renderSuccess(compact('list')); }