From 43cdb752e6ab2624c11bd330c3bb0dec9325d3f1 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Fri, 14 Jun 2024 17:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/user/User.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controller/admin/user/User.php b/app/controller/admin/user/User.php index 50e1a3f..6d65019 100644 --- a/app/controller/admin/user/User.php +++ b/app/controller/admin/user/User.php @@ -201,21 +201,21 @@ class User extends BaseController */ public function update($id, UserValidate $validate, UserLabelRepository $labelRepository, UserGroupRepository $groupRepository) { - $data = $this->request->params(['real_name', 'phone', 'birthday', 'card_id', 'addres', 'mark', 'group_id', ['label_id', []], ['is_promoter', 0], ['status', 0]]); + $data = $this->request->params(['real_name', 'phone', 'birthday', 'card_id', 'addres', 'mark']); $validate->check($data); if (!$this->repository->exists($id)) return app('json')->fail('数据不存在'); - if ($data['group_id'] && !$groupRepository->exists($data['group_id'])) - return app('json')->fail('分组不存在'); - $label_id = (array)$data['label_id']; - foreach ($label_id as $k => $value) { - $label_id[$k] = (int)$value; - if (!$labelRepository->exists((int)$value)) - return app('json')->fail('标签不存在'); - } - $data['label_id'] = implode(',', $label_id); - if ($data['is_promoter']) - $data['promoter_time'] = date('Y-m-d H:i:s'); +// if ($data['group_id'] && !$groupRepository->exists($data['group_id'])) +// return app('json')->fail('分组不存在'); +// $label_id = (array)$data['label_id']; +// foreach ($label_id as $k => $value) { +// $label_id[$k] = (int)$value; +// if (!$labelRepository->exists((int)$value)) +// return app('json')->fail('标签不存在'); +// } +// $data['label_id'] = implode(',', $label_id); +// if ($data['is_promoter']) +// $data['promoter_time'] = date('Y-m-d H:i:s'); if(!$data['birthday']) unset($data['birthday']); $this->repository->update($id, $data);