hasOne(GoodsItem::class, 'id', 'item_id') ->field('id,image,spec_value_str'); } /** * @notes 关联Shop模型 * @return \think\model\relation\HasOne * @author suny * @date 2021/7/13 6:46 下午 */ public function shop() { return $this->hasOne(Shop::class, 'id', 'shop_id') ->field('id,name'); } }