From 953b48e1403c8bf37e6436a399e0de5cb08791ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 20 Apr 2020 15:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Update/controller/Admin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Update/controller/Admin.php b/app/Update/controller/Admin.php index 84e841cd..538336d4 100644 --- a/app/Update/controller/Admin.php +++ b/app/Update/controller/Admin.php @@ -30,12 +30,13 @@ class Admin $old = new \app\admin\model\Admin; // 整理数据 - // $oldId = $old->select()->toArray(); + $oldId = $old->select(); $oldId = $old->column('id'); $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { - $oldList = $old->find($value)->getData(); + $oldList = $value->getData(); + $oldList['school_id'] = $oldList['school']; $newList = $new->create($oldList); if ($newList) { $i ++; @@ -53,12 +54,11 @@ class Admin $old = new \app\teach\model\Banji; // 整理数据 - // $oldId = $old->select()->toArray(); - $oldId = $old->column('id'); + $oldId = $old->select(); $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { - $oldList = $old->find($value)->getData(); + $oldList = $value->getData(); $oldList['school_id'] = $oldList['school']; $oldList['xueduan_id'] = 10302; $newList = $new->create($oldList);