/** * 类型删除 */ public function actionDelete() { $type_id = $this->get('type_id'); //商品类型主表修改 $type_attributes['disabled'] = 'true'; $type_attributes['lastmodify'] = time(); $result = GoodsType::model()->updatebypk($type_id, $type_attributes); if (!$result) { $GoodsType = new GoodsType(); $this->message('error', CHtml::errorSummary($GoodsType), $this->createUrl('index')); } //类型-品牌 $result = TypeBrand::model()->deleteAll('type_id = :type_id', array(':type_id' => $type_id)); if (!$result) { $TypeBrand = new TypeBrand(); $this->message('error', CHtml::errorSummary($TypeBrand), $this->createUrl('index')); } //类型-扩展属性 $result = GoodsTypePropsRelation::model()->deleteAll('type_id = :type_id', array(':type_id' => $type_id)); if (!$result) { $GoodsTypePropsRelation = new GoodsTypePropsRelation(); $this->message('error', CHtml::errorSummary($GoodsTypePropsRelation), $this->createUrl('index')); } //类型-规格 $result = GoodsTypeSpec::model()->deleteAll('type_id = :type_id', array(':type_id' => $type_id)); if (!$result) { $GoodsTypeSpec = new GoodsTypeSpec(); $this->message('error', CHtml::errorSummary($GoodsTypeSpec), $this->createUrl('index')); } $this->message('success', '删除成功', $this->createUrl('index')); }