'timestamp', ]; /** * 商品信息 * @return HasOne */ public function goods() { return $this->hasOne(Goods::class, 'goods_id', 'goods_id')->joinType('left')->withField('goods_id, goods_name,goods_cover')->append([ 'goods_cover_thumb_small','goods_cover_thumb_mid' ])->bind([ 'goods_name', 'goods_cover_thumb_small', 'goods_cover_thumb_mid' ]); } /** * 关联默认商品规格 * @return HasOne */ public function goodsSku() { return $this->hasOne(GoodsSku::class, 'goods_id', 'goods_id')->bind(['price','market_price']); } }