2014-03-01 42 views

回答

0

要做到这一点,你必须修改你的数据库以及一些核心代码。

变化在数据库表:

  1. 变更表 'eav_entity_type':

    check row where entity_type_code=order, 
        set increment_pad_length=1 
    

查询:

update eav_entity_type set increment_pad_length = '1' where entity_type_id = 5; 
  1. 变化表eav_entity_store:

    校验行,其中entity_type_id = 5;

    组increment_last_id = '5000'

查询:

update eav_entity_store set increment_last_id = '5000' where entity_type_id = 5; 

在代码变化:

转到APP /代码/核心/法师/ EAV /模型/实体/增量/ Abstract.php

(a)见的代码:

public function getPadLength() 
{ 
    $padLength = $this->getData('pad_length'); 
    if (empty($padLength)) { 
     $padLength = 0; 
    } 
    return $padLength; 
} 

这里改变

$padLength = 0; 

(b)中看到的代码:

public function format($id) 
{ 
    // $result = $this->getPrefix(); 
    $result.= str_pad((string)$id, $this->getPadLength(), $this->getPadChar(), STR_PAD_LEFT); 
    return $result; 
} 

注释行:

//$result = $this->getPrefix(); 

你完成了。让我知道你是否有任何公关关于这个问题。

+0

感谢,它的工作原理。 – user3368259

相关问题