@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if (isset($searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
| 149 | 149 | //スペース除去 |
| 150 | - $clean_key_multi = preg_replace('/\s+|[ ]+/u', '',$searchData['multi']); |
|
| 150 | + $clean_key_multi = preg_replace('/\s+|[ ]+/u', '', $searchData['multi']); |
|
| 151 | 151 | if (preg_match('/^\d+$/', $clean_key_multi)) { |
| 152 | 152 | $qb |
| 153 | 153 | ->andWhere('c.id = :customer_id') |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | } else { |
| 156 | 156 | $qb |
| 157 | 157 | ->andWhere('CONCAT(c.name01, c.name02) LIKE :name OR CONCAT(c.kana01, c.kana02) LIKE :kana OR c.email LIKE :email') |
| 158 | - ->setParameter('name', '%' . $clean_key_multi . '%') |
|
| 159 | - ->setParameter('kana', '%' . $clean_key_multi . '%') |
|
| 160 | - ->setParameter('email', '%' . $clean_key_multi . '%'); |
|
| 158 | + ->setParameter('name', '%'.$clean_key_multi.'%') |
|
| 159 | + ->setParameter('kana', '%'.$clean_key_multi.'%') |
|
| 160 | + ->setParameter('email', '%'.$clean_key_multi.'%'); |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
| 211 | 211 | $qb |
| 212 | 212 | ->andWhere('CONCAT(c.tel01, c.tel02, c.tel03) LIKE :tel') |
| 213 | - ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 213 | + ->setParameter('tel', '%'.$searchData['tel'].'%'); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // buy_total |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | ->leftJoin('c.Orders', 'o') |
| 305 | 305 | ->leftJoin('o.OrderDetails', 'od') |
| 306 | 306 | ->andWhere('od.product_name LIKE :buy_product_name OR od.product_code LIKE :buy_product_name') |
| 307 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_code'] . '%'); |
|
| 307 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_code'].'%'); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | // Order By |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
| 275 | 275 | $qb |
| 276 | 276 | ->andWhere('o.id = :multi OR o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR ' . |
| 277 | - 'o.kana01 LIKE :likemulti OR o.kana02 LIKE :likemulti OR o.company_name LIKE :likemulti') |
|
| 277 | + 'o.kana01 LIKE :likemulti OR o.kana02 LIKE :likemulti OR o.company_name LIKE :likemulti') |
|
| 278 | 278 | ->setParameter('multi', $multi) |
| 279 | 279 | ->setParameter('likemulti', '%' . $searchData['multi'] . '%'); |
| 280 | 280 | } |
@@ -100,14 +100,14 @@ discard block |
||
| 100 | 100 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
| 101 | 101 | $qb |
| 102 | 102 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
| 103 | - ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 103 | + ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // kana |
| 107 | 107 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
| 108 | 108 | $qb |
| 109 | 109 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
| 110 | - ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 110 | + ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $qb |
| 245 | 245 | ->leftJoin('o.OrderDetails', 'od') |
| 246 | 246 | ->andWhere('od.product_name LIKE :buy_product_name') |
| 247 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
| 247 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // Order By |
@@ -270,13 +270,13 @@ discard block |
||
| 270 | 270 | ->setParameter('order_id_start', $searchData['order_id_start']); |
| 271 | 271 | } |
| 272 | 272 | // multi |
| 273 | - if (isset( $searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
| 273 | + if (isset($searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
| 274 | 274 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
| 275 | 275 | $qb |
| 276 | - ->andWhere('o.id = :multi OR o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR ' . |
|
| 276 | + ->andWhere('o.id = :multi OR o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR '. |
|
| 277 | 277 | 'o.kana01 LIKE :likemulti OR o.kana02 LIKE :likemulti OR o.company_name LIKE :likemulti') |
| 278 | 278 | ->setParameter('multi', $multi) |
| 279 | - ->setParameter('likemulti', '%' . $searchData['multi'] . '%'); |
|
| 279 | + ->setParameter('likemulti', '%'.$searchData['multi'].'%'); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | // order_id_end |
@@ -301,28 +301,28 @@ discard block |
||
| 301 | 301 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
| 302 | 302 | $qb |
| 303 | 303 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
| 304 | - ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 304 | + ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | // kana |
| 308 | 308 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
| 309 | 309 | $qb |
| 310 | 310 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
| 311 | - ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 311 | + ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
| 316 | 316 | $qb |
| 317 | 317 | ->andWhere('o.email like :email') |
| 318 | - ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 318 | + ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // tel |
| 322 | 322 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
| 323 | 323 | $qb |
| 324 | 324 | ->andWhere('CONCAT(o.tel01, o.tel02, o.tel03) LIKE :tel') |
| 325 | - ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 325 | + ->setParameter('tel', '%'.$searchData['tel'].'%'); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | // sex |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $qb |
| 435 | 435 | ->leftJoin('o.OrderDetails', 'od') |
| 436 | 436 | ->andWhere('od.product_name LIKE :buy_product_name') |
| 437 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
| 437 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | |
@@ -257,7 +257,7 @@ |
||
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | foreach ($readPaths as $readPath) { |
| 260 | - $filePath = $readPath . '/' . $fileName . '.twig'; |
|
| 260 | + $filePath = $readPath.'/'.$fileName.'.twig'; |
|
| 261 | 261 | $fs = new Filesystem(); |
| 262 | 262 | if ($fs->exists($filePath)) { |
| 263 | 263 | return array( |
@@ -73,17 +73,17 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $qb = $this->createQueryBuilder('e'); |
| 75 | 75 | $qb->andWhere("e.priority >= $range_end ") |
| 76 | - ->andWhere("e.priority <= $range_start ") |
|
| 77 | - ->andWhere('e.event = :event') |
|
| 78 | - ->setParameter('event',$event) |
|
| 79 | - ->setMaxResults(1) |
|
| 80 | - ->orderBy('e.priority','ASC'); |
|
| 76 | + ->andWhere("e.priority <= $range_start ") |
|
| 77 | + ->andWhere('e.event = :event') |
|
| 78 | + ->setParameter('event',$event) |
|
| 79 | + ->setMaxResults(1) |
|
| 80 | + ->orderBy('e.priority','ASC'); |
|
| 81 | 81 | |
| 82 | 82 | $result=$qb->getQuery()->getResult(); |
| 83 | 83 | if(count($result)){ |
| 84 | - return $result[0]->getPriority() -1; |
|
| 84 | + return $result[0]->getPriority() -1; |
|
| 85 | 85 | }else{ |
| 86 | - return $range_start; |
|
| 86 | + return $range_start; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | $qb = $this->createQueryBuilder('e'); |
| 97 | 97 | |
| 98 | 98 | $qb->andWhere("e.priority >= $range_end ") |
| 99 | - ->andWhere("e.priority <= $range_start ") |
|
| 100 | - ->andWhere("e.del_flg = 0 ") |
|
| 101 | - ->andWhere('e.priority '.($up ? '>' : '<' ).' :pri') |
|
| 102 | - ->andWhere('e.event = :event') |
|
| 103 | - ->setParameter('event',$pluginEventHandler->getEvent()) |
|
| 104 | - ->setParameter('pri', $pluginEventHandler->getPriority() ) |
|
| 105 | - ->setMaxResults(1) |
|
| 106 | - ->orderBy('e.priority', ($up ? 'ASC':'DESC' ) ); |
|
| 99 | + ->andWhere("e.priority <= $range_start ") |
|
| 100 | + ->andWhere("e.del_flg = 0 ") |
|
| 101 | + ->andWhere('e.priority '.($up ? '>' : '<' ).' :pri') |
|
| 102 | + ->andWhere('e.event = :event') |
|
| 103 | + ->setParameter('event',$pluginEventHandler->getEvent()) |
|
| 104 | + ->setParameter('pri', $pluginEventHandler->getPriority() ) |
|
| 105 | + ->setMaxResults(1) |
|
| 106 | + ->orderBy('e.priority', ($up ? 'ASC':'DESC' ) ); |
|
| 107 | 107 | |
| 108 | 108 | $result=$qb->getQuery()->getResult(); |
| 109 | 109 | |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $qb = $this->createQueryBuilder('e') |
| 43 | 43 | ->innerJoin('e.Plugin', 'p') |
| 44 | 44 | ->andWhere('e.del_flg = 0 ') |
| 45 | - ->Orderby('e.event','ASC') |
|
| 46 | - ->addOrderby('e.priority','DESC'); |
|
| 45 | + ->Orderby('e.event', 'ASC') |
|
| 46 | + ->addOrderby('e.priority', 'DESC'); |
|
| 47 | 47 | ; |
| 48 | 48 | |
| 49 | 49 | return $qb->getQuery()->getResult(); |
@@ -52,66 +52,66 @@ discard block |
||
| 52 | 52 | public function getPriorityRange($type) |
| 53 | 53 | { |
| 54 | 54 | |
| 55 | - if(PluginEventHandler::EVENT_HANDLER_TYPE_FIRST==$type){ |
|
| 56 | - $range_start=PluginEventHandler::EVENT_PRIORITY_FIRST_START; |
|
| 57 | - $range_end=PluginEventHandler::EVENT_PRIORITY_FIRST_END; |
|
| 58 | - }elseif(PluginEventHandler::EVENT_HANDLER_TYPE_LAST==$type){ |
|
| 59 | - $range_start=PluginEventHandler::EVENT_PRIORITY_LAST_START; |
|
| 60 | - $range_end=PluginEventHandler::EVENT_PRIORITY_LAST_END; |
|
| 61 | - }else{ |
|
| 62 | - $range_start=PluginEventHandler::EVENT_PRIORITY_NORMAL_START; |
|
| 63 | - $range_end=PluginEventHandler::EVENT_PRIORITY_NORMAL_END; |
|
| 55 | + if (PluginEventHandler::EVENT_HANDLER_TYPE_FIRST == $type) { |
|
| 56 | + $range_start = PluginEventHandler::EVENT_PRIORITY_FIRST_START; |
|
| 57 | + $range_end = PluginEventHandler::EVENT_PRIORITY_FIRST_END; |
|
| 58 | + }elseif (PluginEventHandler::EVENT_HANDLER_TYPE_LAST == $type) { |
|
| 59 | + $range_start = PluginEventHandler::EVENT_PRIORITY_LAST_START; |
|
| 60 | + $range_end = PluginEventHandler::EVENT_PRIORITY_LAST_END; |
|
| 61 | + } else { |
|
| 62 | + $range_start = PluginEventHandler::EVENT_PRIORITY_NORMAL_START; |
|
| 63 | + $range_end = PluginEventHandler::EVENT_PRIORITY_NORMAL_END; |
|
| 64 | 64 | } |
| 65 | - return array($range_start,$range_end); |
|
| 65 | + return array($range_start, $range_end); |
|
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function calcNewPriority($event , $type) |
|
| 69 | + public function calcNewPriority($event, $type) |
|
| 70 | 70 | { |
| 71 | 71 | |
| 72 | - list($range_start,$range_end) = $this->getPriorityRange($type); |
|
| 72 | + list($range_start, $range_end) = $this->getPriorityRange($type); |
|
| 73 | 73 | |
| 74 | 74 | $qb = $this->createQueryBuilder('e'); |
| 75 | 75 | $qb->andWhere("e.priority >= $range_end ") |
| 76 | 76 | ->andWhere("e.priority <= $range_start ") |
| 77 | 77 | ->andWhere('e.event = :event') |
| 78 | - ->setParameter('event',$event) |
|
| 78 | + ->setParameter('event', $event) |
|
| 79 | 79 | ->setMaxResults(1) |
| 80 | - ->orderBy('e.priority','ASC'); |
|
| 80 | + ->orderBy('e.priority', 'ASC'); |
|
| 81 | 81 | |
| 82 | - $result=$qb->getQuery()->getResult(); |
|
| 83 | - if(count($result)){ |
|
| 84 | - return $result[0]->getPriority() -1; |
|
| 85 | - }else{ |
|
| 82 | + $result = $qb->getQuery()->getResult(); |
|
| 83 | + if (count($result)) { |
|
| 84 | + return $result[0]->getPriority() - 1; |
|
| 85 | + } else { |
|
| 86 | 86 | return $range_start; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function upPriority($pluginEventHandler,$up=true) |
|
| 91 | + public function upPriority($pluginEventHandler, $up = true) |
|
| 92 | 92 | { |
| 93 | 93 | |
| 94 | - list($range_start,$range_end) = $this->getPriorityRange($pluginEventHandler->getHandlerType()); |
|
| 94 | + list($range_start, $range_end) = $this->getPriorityRange($pluginEventHandler->getHandlerType()); |
|
| 95 | 95 | |
| 96 | 96 | $qb = $this->createQueryBuilder('e'); |
| 97 | 97 | |
| 98 | 98 | $qb->andWhere("e.priority >= $range_end ") |
| 99 | 99 | ->andWhere("e.priority <= $range_start ") |
| 100 | 100 | ->andWhere("e.del_flg = 0 ") |
| 101 | - ->andWhere('e.priority '.($up ? '>' : '<' ).' :pri') |
|
| 101 | + ->andWhere('e.priority '.($up ? '>' : '<').' :pri') |
|
| 102 | 102 | ->andWhere('e.event = :event') |
| 103 | - ->setParameter('event',$pluginEventHandler->getEvent()) |
|
| 104 | - ->setParameter('pri', $pluginEventHandler->getPriority() ) |
|
| 103 | + ->setParameter('event', $pluginEventHandler->getEvent()) |
|
| 104 | + ->setParameter('pri', $pluginEventHandler->getPriority()) |
|
| 105 | 105 | ->setMaxResults(1) |
| 106 | - ->orderBy('e.priority', ($up ? 'ASC':'DESC' ) ); |
|
| 106 | + ->orderBy('e.priority', ($up ? 'ASC' : 'DESC')); |
|
| 107 | 107 | |
| 108 | - $result=$qb->getQuery()->getResult(); |
|
| 108 | + $result = $qb->getQuery()->getResult(); |
|
| 109 | 109 | |
| 110 | - if(count($result)){ |
|
| 111 | - $em =$this->getEntityManager(); |
|
| 110 | + if (count($result)) { |
|
| 111 | + $em = $this->getEntityManager(); |
|
| 112 | 112 | $em->getConnection()->beginTransaction(); |
| 113 | 113 | // 2個のentityのprioriryを入れ替える |
| 114 | - $tmp=$pluginEventHandler->getPriority(); |
|
| 114 | + $tmp = $pluginEventHandler->getPriority(); |
|
| 115 | 115 | $pluginEventHandler->setPriority($result[0]->getPriority()); |
| 116 | 116 | $result[0]->setPriority($tmp); |
| 117 | 117 | $em->persist($result[0]); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $em->flush(); |
| 120 | 120 | $em->getConnection()->commit(); |
| 121 | 121 | # 移動する |
| 122 | - }else{ |
|
| 122 | + } else { |
|
| 123 | 123 | # 移動しない |
| 124 | 124 | throw new PluginException("Can't swap"); |
| 125 | 125 | } |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | if(PluginEventHandler::EVENT_HANDLER_TYPE_FIRST==$type){ |
| 56 | 56 | $range_start=PluginEventHandler::EVENT_PRIORITY_FIRST_START; |
| 57 | 57 | $range_end=PluginEventHandler::EVENT_PRIORITY_FIRST_END; |
| 58 | - }elseif(PluginEventHandler::EVENT_HANDLER_TYPE_LAST==$type){ |
|
| 58 | + } elseif(PluginEventHandler::EVENT_HANDLER_TYPE_LAST==$type){ |
|
| 59 | 59 | $range_start=PluginEventHandler::EVENT_PRIORITY_LAST_START; |
| 60 | 60 | $range_end=PluginEventHandler::EVENT_PRIORITY_LAST_END; |
| 61 | - }else{ |
|
| 61 | + } else{ |
|
| 62 | 62 | $range_start=PluginEventHandler::EVENT_PRIORITY_NORMAL_START; |
| 63 | 63 | $range_end=PluginEventHandler::EVENT_PRIORITY_NORMAL_END; |
| 64 | 64 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $result=$qb->getQuery()->getResult(); |
| 83 | 83 | if(count($result)){ |
| 84 | 84 | return $result[0]->getPriority() -1; |
| 85 | - }else{ |
|
| 85 | + } else{ |
|
| 86 | 86 | return $range_start; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $em->flush(); |
| 120 | 120 | $em->getConnection()->commit(); |
| 121 | 121 | # 移動する |
| 122 | - }else{ |
|
| 122 | + } else{ |
|
| 123 | 123 | # 移動しない |
| 124 | 124 | throw new PluginException("Can't swap"); |
| 125 | 125 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $key = sprintf('keyword%s', $index); |
| 100 | 100 | $qb |
| 101 | 101 | ->andWhere(sprintf('p.name LIKE :%s OR p.search_word LIKE :%s', $key, $key)) |
| 102 | - ->setParameter($key, '%' . $keyword . '%'); |
|
| 102 | + ->setParameter($key, '%'.$keyword.'%'); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $qb |
| 145 | 145 | ->andWhere('p.id = :id OR p.name LIKE :likeid OR pc.code LIKE :likeid') |
| 146 | 146 | ->setParameter('id', $id) |
| 147 | - ->setParameter('likeid', '%' . $searchData['id'] . '%'); |
|
| 147 | + ->setParameter('likeid', '%'.$searchData['id'].'%'); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // code |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function up(Schema $schema) |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - if($this->connection->getDatabasePlatform()->getName() == "mysql"){ |
|
| 19 | + if ($this->connection->getDatabasePlatform()->getName() == "mysql") { |
|
| 20 | 20 | // this up() migration is auto-generated, please modify it to your needs |
| 21 | 21 | $this->addSql("alter table dtb_base_info collate utf8_general_ci ;"); |
| 22 | 22 | $this->addSql("alter table dtb_block collate utf8_general_ci ;"); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $t = $schema->getTable('dtb_product_class'); |
| 43 | 43 | $c = $t->getColumn('stock_unlimited'); |
| 44 | 44 | |
| 45 | - if($c->getType()->getName() != 'smallint'){ |
|
| 45 | + if ($c->getType()->getName() != 'smallint') { |
|
| 46 | 46 | $this->addSql('ALTER TABLE dtb_product_class ADD stock_unlimited_tmp int ;'); |
| 47 | 47 | $this->addSql('UPDATE dtb_product_class SET stock_unlimited_tmp = 1 where stock_unlimited = true '); |
| 48 | 48 | $this->addSql('UPDATE dtb_product_class SET stock_unlimited_tmp = 0 where stock_unlimited <> true '); |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | public function up(Schema $schema) |
| 39 | 39 | { |
| 40 | 40 | // this up() migration is auto-generated, please modify it to your needs |
| 41 | - $t=$schema->getTable('dtb_product_class'); |
|
| 42 | - if(!$t->hasColumn('stock_unlimited') && $t->hasColumn('stock_unlimited_tmp')){ |
|
| 41 | + $t = $schema->getTable('dtb_product_class'); |
|
| 42 | + if (!$t->hasColumn('stock_unlimited') && $t->hasColumn('stock_unlimited_tmp')) { |
|
| 43 | 43 | $t->addColumn('stock_unlimited', 'smallint', array('NotNull'=>true, 'Default'=>0)); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | public function up(Schema $schema) |
| 40 | 40 | { |
| 41 | 41 | // this up() migration is auto-generated, please modify it to your needs |
| 42 | - $t=$schema->getTable('dtb_product_class'); |
|
| 43 | - if($t->hasColumn('stock_unlimited_tmp')){ |
|
| 42 | + $t = $schema->getTable('dtb_product_class'); |
|
| 43 | + if ($t->hasColumn('stock_unlimited_tmp')) { |
|
| 44 | 44 | $this->addSql('update dtb_product_class set stock_unlimited = stock_unlimited_tmp;'); |
| 45 | 45 | $t->dropColumn('stock_unlimited_tmp'); |
| 46 | 46 | } |