hasMany('App\Models\ConfigStoreType','store_ids'); } //获取储存方式名称 public function getStoreNameAttribute() { $storeId = ConfigStoreType::find($this->store_ids); if($storeId){ return $storeId->name; } return ''; } }