4,250
社区成员
发帖
与我相关
我的任务
分享 class Goods extends CActiveRecord
{
public static function model($className = __CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return '{{goods}}';
}
} public function actionDel($id)
{
$goods_model = Goods::model();
$goods_info = $goods_model->findByPk($id);
if($goods_info->delete()) //报错,没有delete函数,但是数据已经删除了
{
$this->redirect('index.php');
}
}