```php
//获取当前最大的ID并 +1
$maxId = $this->model->max('contract_id');
$contract_id = $maxId+1;
//判断编号位数,不足10位,用0补足
if(strlen($contract_id) < 10){
$tempString = "";
for($i=0;$i<(10-strlen($contract_id));$i++){
$tempString .= "0";
}
$contract_id =$tempString.$contract_id;
}