Exemplo n.º 1
0
 public function getFindComment()
 {
     return $this->hasOne(OrderDetail::className(), ['id' => 'typeId']);
 }
Exemplo n.º 2
0
 public function getProductdetail()
 {
     //同样第一个参数指定关联的子表模型类名
     //
     return $this->hasMany(OrderDetail::className(), ['orderId' => 'id']);
 }