Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNodes()
 {
     return $this->hasMany(Node::className(), ['tab_id' => 'id'])->orderBy(['sort' => SORT_ASC]);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNode()
 {
     return $this->hasOne(Node::className(), ['id' => 'node_id']);
 }
Exemplo n.º 3
0
Arquivo: Node.php Projeto: npk/v2sex
 /**
  * 获取相关节点
  * @return \yii\db\ActiveQuery
  */
 public function getRelated()
 {
     return $this->hasMany(Node::className(), ['parent_id' => 'parent_id'])->where('id != ' . $this->id)->orderBy(['sort' => SORT_ASC]);
 }