在 controller类中加入 :
try {
.....
} catch(CDbException $e) {
$model->addError('price_device_mac',"Failed to execute the SQL statement,do not insert duplicated mac address please!");
}
在 controller类中加入 :
try {
.....
} catch(CDbException $e) {
$model->addError('price_device_mac',"Failed to execute the SQL statement,do not insert duplicated mac address please!");
}