'ID', 'userId' => 'User ID', 'merchantId' => 'Merchant ID', 'goodsId' => 'Goods ID', 'goodsPriceId' => 'Goods Price Id', 'num' => 'Num', 'createTime' => 'Create Time', 'updateTime' => 'Update Time', ]; } public function getXhGoods() { // 关系和商品通过 Goods.id -> goodsId 关联建立一对一关系 return $this->hasOne(xhGoods::className(), ['id' => 'goodsId']); } }