3.1.3 BELONGS_TO 关联 删除不了关联表的记录?

浏览:523 发布日期:2014/01/08 分类:求助交流 关键字: BELONGS_TO 关联 删除
protected $tableName = 'iccard_records';
    protected $_link = array(
        'card1' => array(
            'mapping_type' => BELONGS_TO
            , 'class_name' => 'iccard' 
            , 'foreign_key' => 'card1_id' 
            , 'mapping_fields' => array('card', 'manufacturer', 'time') 
        )
        , 'card2' => array(
            'mapping_type' => BELONGS_TO
            , 'class_name' => 'iccard'
            , 'foreign_key' => 'card2_id'
            , 'mapping_fields' => array('card', 'manufacturer', 'time') 
        )
D('IccardRelation')->relation(TRUE)
->where(array('id' => array('in', $id)))
->delete();
iccard_records 的记录能删除
iccard 表中的记录无法删除

原因何在?求高手解答
最佳答案
评论( 相关
后面还有条评论,点击查看>>