protected function initOptions() { $arr = ['where','order','limit','group','field','table','having']; //将$this->options[]数组的值设为空,下标为指定的键名 foreach($arr as $value){ $this->options[$value] = ''; if($value == 'field'){ //数组拼接为字符串 array_unique去除重复 $this->options[$value] = join(',',array_unique($this->fields));}else if($value == 'table'){ $this->options[$value] = $this->tableName; } } }
这是今天敲的其中一小段代码,思路理得不清晰,找bug也都不容易呀!是个惨痛的教训.因此,我决定发表鞭策一下自己.每一天加油,你会很棒的!