content['min_price'] == $this->content['max_price']) { $sell_price = "{$this->content['min_price']}"; } else { $sell_price = "{$this->content['min_price']}~{$this->content['max_price']}"; } return [ 'presell_price' => $presell_price, 'presell_min_price' => "{$data['min_price']}", 'presell_max_price' => "{$data['max_price']}", 'sell_price' => $sell_price, 'sell_min_price' => "{$this->content['min_price']}", 'sell_max_price' => "{$this->content['max_price']}", 'name' => $this->content['name'] ?? '', 'image' => $this->content['image'] ?? '', ]; } /** * @notes 预售商品规格列表 * @return \think\model\relation\HasMany * @author lbzy * @datetime 2024-04-24 14:19:51 */ function items() { return $this->hasMany(PresellGoodsItem::class, 'presell_goods_id', 'id'); } function item() { return $this->hasMany(PresellGoodsItem::class, 'presell_goods_id', 'id'); } /** * @notes 商品详情 * @return \think\model\relation\HasOne * @author lbzy * @datetime 2024-04-24 14:19:39 */ function detail() { return $this->hasOne(Goods::class, 'id', 'goods_id'); } }