fiaw 2011-07-28 09:26:06 4057次浏览 12条回复 0 0 0

blog里面的 post类中

public function relations()
{
  return array(
    'author' => array(self::BELONGS_TO, 'User', 'author_id‘),
    'comments' => array(self::HAS_MANY, 'Comment', 'post_id',
    'condition'=>'comments.status='.Comment::STATUS_APPROVED,
    'order'=>'comments.create_time DESC'),
    'commentCount' => array(self::STAT, 'Comment', 'post_id',
    'condition'=>'status='.Comment::STATUS_APPROVED),
  );
}

里面的 author是哪个表里的,author 是哪个表里的, 怎么都没指明是哪个表的,里面的author,comment ,condition,condition 不是应该都是属于 post表的吗? 请说的详细些。。。

您需要登录后才可以回复。登录 | 立即注册