示例#1
0
 /**
  * 通过二级导航关联一级导航
  */
 public function getNavbar()
 {
     return $this->hasOne(AgNavbar::className(), ['id' => 'nbid'])->andWhere(['status' => 1]);
     //这里是navbar里status=1
 }
示例#2
0
文件: AgNav.php 项目: dlpc/yii2-plane
 /**
  * 关联二级导航
  */
 public function getNavbar()
 {
     return $this->hasMany(AgNavbar::className(), ['nid' => 'id']);
 }