From 198bcba72de43fe946c1c1b66ba4a3989cece821 Mon Sep 17 00:00:00 2001 From: migarashi Date: Thu, 27 Aug 2015 17:25:08 +0900 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=94=BB=E9=9D=A2=E5=81=B4?= =?UTF-8?q?=E3=81=AE=E4=BC=9A=E5=93=A1=E7=99=BB=E9=8C=B2=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=80=81dtb=5Fcustomer=5Faddress=E3=81=AB=E4=BD=8F=E6=89=80?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=8C=E7=99=BB=E9=8C=B2=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=80=82#678?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 編集時にdtb_customer_addressにデータが追加されていくバグ修正 dtb_customer_addressに対する操作は新規登録時のみで更新は行わない --- .../Admin/Customer/CustomerEditController.php | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Eccube/Controller/Admin/Customer/CustomerEditController.php b/src/Eccube/Controller/Admin/Customer/CustomerEditController.php index c57aa9521eb..44b096b2905 100644 --- a/src/Eccube/Controller/Admin/Customer/CustomerEditController.php +++ b/src/Eccube/Controller/Admin/Customer/CustomerEditController.php @@ -48,7 +48,8 @@ public function index(Application $app, Request $request, $id = null) $Customer->setPassword($app['config']['default_password']); // 新規登録 } else { - $Customer = $app['eccube.repository.customer']->newCustomer(); + $Customer = $app['eccube.repository.customer']->newCustomer(); + $CustomerAddress = new \Eccube\Entity\CustomerAddress(); } // 会員登録フォーム @@ -70,6 +71,27 @@ public function index(Application $app, Request $request, $id = null) ->getRepository('Eccube\Entity\Customer') ->getUniqueSecretKey($app) ); + + $CustomerAddress->setName01($Customer->getName01()) + ->setName02($Customer->getName02()) + ->setKana01($Customer->getKana01()) + ->setKana02($Customer->getKana02()) + ->setCompanyName($Customer->getCompanyName()) + ->setZip01($Customer->getZip01()) + ->setZip02($Customer->getZip02()) + ->setZipcode($Customer->getZip01() . $Customer->getZip02()) + ->setPref($Customer->getPref()) + ->setAddr01($Customer->getAddr01()) + ->setAddr02($Customer->getAddr02()) + ->setTel01($Customer->getTel01()) + ->setTel02($Customer->getTel02()) + ->setTel03($Customer->getTel03()) + ->setFax01($Customer->getFax01()) + ->setFax02($Customer->getFax02()) + ->setFax03($Customer->getFax03()) + ->setDelFlg(Constant::DISABLED) + ->setCustomer($Customer); + $app['orm.em']->persist($CustomerAddress); } if ($Customer->getPassword() === $app['config']['default_password']) { @@ -82,29 +104,7 @@ public function index(Application $app, Request $request, $id = null) ); } - $CustomerAddress = new \Eccube\Entity\CustomerAddress(); - $CustomerAddress->setName01($Customer->getName01()) - ->setName02($Customer->getName02()) - ->setKana01($Customer->getKana01()) - ->setKana02($Customer->getKana02()) - ->setCompanyName($Customer->getCompanyName()) - ->setZip01($Customer->getZip01()) - ->setZip02($Customer->getZip02()) - ->setZipcode($Customer->getZip01() . $Customer->getZip02()) - ->setPref($Customer->getPref()) - ->setAddr01($Customer->getAddr01()) - ->setAddr02($Customer->getAddr02()) - ->setTel01($Customer->getTel01()) - ->setTel02($Customer->getTel02()) - ->setTel03($Customer->getTel03()) - ->setFax01($Customer->getFax01()) - ->setFax02($Customer->getFax02()) - ->setFax03($Customer->getFax03()) - ->setDelFlg(Constant::DISABLED) - ->setCustomer($Customer); - $app['orm.em']->persist($Customer); - $app['orm.em']->persist($CustomerAddress); $app['orm.em']->flush(); $app->addSuccess('admin.customer.save.complete', 'admin');