tp_vip:id,name,tel,address,pid,time,remark
tp_product:id,type,number,status关系:pid记录product表的id.现在想操作:vip表发布信息,同时把product表的status 的值改变为1,默认是0
class VipRelationModel extends RelationModel{
protected $tableName='vip';//定义主表
protected $_link=array(
'product'=> array(
'mapping_type'=>BELONGS_TO,
'class_name'=>'product',
'foreign_key'=>'pid',
'mapping_name'=>'product',
)
);
}
?>写了一个关联模型,主表成功,副表更改不了,有什么办法吗? 最佳答案