Browse Source

增加订单表和订单商品表的关联方法

antshop
linyaostalker 5 years ago
parent
commit
fddd9fea60
  1. 6
      backend/modules/shop/models/ars/OrderGoods.php

6
backend/modules/shop/models/ars/OrderGoods.php

@ -4,6 +4,7 @@ namespace backend\modules\shop\models\ars;
use Yii;
use yii\behaviors\TimestampBehavior;
use backend\modules\shop\models\ars\Order;
/**
* This is the model class for table "ats_order_goods".
@ -87,4 +88,9 @@ class OrderGoods extends \yii\db\ActiveRecord
],
];
}
public function getOrder()
{
return $this->hasOne(Order::className(), ['id' => 'order_id']);
}
}
Loading…
Cancel
Save