255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'order_id' => 'Order ID', 'goods_id' => 'Goods ID', 'num' => '商品数量', 'total_price' => '此商品的总价', 'addtime' => 'Addtime', 'is_delete' => 'Is Delete', 'attr' => '商品规格', 'pic' => '商品规格图片', ]; } public function getGoods() { return $this->hasOne(PtGoods::className(), ['id' => 'goods_id']); } public function getShare() { return $this->hasOne(GoodsShare::className(), ['goods_id' => 'goods_id'])->where(['type' => 0]); } /** * 拼团订单总数 * @return \yii\db\ActiveQuery */ public function getOrder() { return $this->hasMany(PtOrder::className(), ['id' => 'order_id']); } }