?????????thinkphp?????????????????д?д?????????Сд???????????????$model->_sql()???????????е?sql????
????????????????????????? Thinkphp/Common/common.php???棬?????????????????????????д????????????+Сд??

 

1 function parse_name($name?? $type=0) {
2     if ($type) {
3         return ucfirst(preg_replace("/_([a-zA-Z])/e"?? "strtoupper('\1')"?? $name));
4     } else {
5         return strtolower(trim(preg_replace("/[A-Z]/"?? "_\0"?? $name)?? "_"));
6         //<feixiang 2013??7??6?? ?????????????????д???? _Сд?????????????Model.class.php?????????????Сд?????????? >
7         //echo $name ;
8         //return $name;
9     }
10 }

?????????? Thinkphp/Core/Model.class.php???棬???????????????Сд??

 

1     public function getTableName() {
2         if(empty($this->trueTableName)) {
3             $tableName  = !empty($this->tablePrefix) ? $this->tablePrefix : '';
4             if(!empty($this->tableName)) {
5                 $tableName .= $this->tableName;
6             }else{
7                 $tableName .= parse_name($this->name);
8             }
9             //<feixiang ??????????????Сд?????????????>
10             $this->trueTableName    =   strtolower($tableName);
11             //$this->trueTableName    =   $tableName;
12         }
13         return (!empty($this->dbName)?$this->dbName.'.':'').$this->trueTableName;
14     }

?????????к??——?淶??
???????????????????У??д?д?????????????????£???????Щ??...
???????????????????????????
????protected $trueTableName = 'myTableName';
??????????$this->trueTableName