Changeset 22012 for branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
- Timestamp:
- 2012/08/30 14:15:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
r21867 r22012 469 469 $rank = $objQuery->get('rank', 'dtb_category', $where, array($parent_category_id)); 470 470 // 追加レコードのランク以上のレコードを一つあげる。 471 $sqlup = 'UPDATE dtb_category SET rank = (rank + 1) WHERE rank >= ?'; 472 $objQuery->exec($sqlup, array($rank)); 471 $where = 'rank >= ?'; 472 $arrRawSql = array( 473 'rank' => '(rank + 1)', 474 ); 475 $objQuery->update('dtb_category', array(), $where, array($rank), $arrRawSql); 473 476 } 474 477 … … 564 567 $arrRet = $objDb->sfGetChildrenArray($table, $pid_name, $id_name, $id); 565 568 $line = SC_Utils_Ex::sfGetCommaList($arrRet); 566 $sql = "UPDATE $table SET rank = (rank + $count) WHERE $id_name IN ($line) "; 567 $sql.= 'AND del_flg = 0'; 568 $ret = $objQuery->exec($sql); 569 return $ret; 569 $where = "$id_name IN ($line) AND del_flg = 0"; 570 $arrRawVal = array( 571 'rank' => "(rank + $count)", 572 ); 573 return $objQuery->update($table, array(), $where, array(), $arrRawVal); 570 574 } 571 575 … … 575 579 $arrRet = $objDb->sfGetChildrenArray($table, $pid_name, $id_name, $id); 576 580 $line = SC_Utils_Ex::sfGetCommaList($arrRet); 577 $sql = "UPDATE $table SET rank = (rank - $count) WHERE $id_name IN ($line) "; 578 $sql.= 'AND del_flg = 0'; 579 $ret = $objQuery->exec($sql); 580 return $ret; 581 $where = "$id_name IN ($line) AND del_flg = 0"; 582 $arrRawVal = array( 583 'rank' => "(rank - $count)", 584 ); 585 return $objQuery->update($table, array(), $where, array(), $arrRawVal); 581 586 } 582 587 }
Note: See TracChangeset
for help on using the changeset viewer.