2019-08-07 10:53:24 1677次浏览 4条回答 0 悬赏 20 金钱

有 cateid 字段的值为 1,3,6 这样
对应另一张 cate 表的 id
在 model 中的 relations() 应该怎么写

public function relations()
{
    // NOTE: you may need to adjust the relation name and the related
    // class name for the relations automatically generated below.
    return array(
        'cate'=>array(self::BELONGS_TO, 'Cate', 'cateid')
    );
}

我这样写只能返回一个

您需要登录后才可以回答。登录 | 立即注册
☆一蚊一打龟
主管

☆一蚊一打龟 广东佛山

注册时间:2019-07-08
最后登录:2019-10-23
在线时长:7小时44分
  • 粉丝0
  • 金钱490
  • 威望0
  • 积分560

热门问题