[ 'id' => $this->id, 'title' => $this->title, 'img' => $this->storage_id ? $this->storage ? 'http://www.bohaimingpin.com'.$this->storage->path : '' : '', 'price'=> 0, 'score'=> $this->max_score , 'original'=>$this->min_original, 'description'=>$this->description, 'content'=> str_replace('/uploads/images', 'http://www.bohaimingpin.com/uploads/images',$this->content), 'tag' =>[ 'is_new'=> $this->is_recommend == 1 ? true : false, ], ], 'seller'=>[ 'id'=>$this->seller_id, 'name'=>$this->seller->name ?? '', 'logo'=>$this->seller->storage_id ? $this->seller->storage ? 'http://www.bohaimingpin.com'.$this->seller->storage->path : '' : '', 'description'=>$this->seller->description, ], 'attribute'=> GoodsParamsResource::collection($this->params()->where('status', 1)->where('stock', '>', 0)->where('score', '>', 0)->whereRaw('price = score')->get()), ]; } }