|
@@ -9,17 +9,17 @@ use Illuminate\Support\Arr;
|
|
|
/**
|
|
|
* App\Models\Goods\Goods
|
|
|
*
|
|
|
- * @property int $id
|
|
|
- * @property string $name
|
|
|
- * @property array $image_list
|
|
|
- * @property array $spec 商品的规格
|
|
|
- * @property int $weight
|
|
|
- * @property string|null $desc_html
|
|
|
- * @property string|null $spec_attr_html
|
|
|
- * @property string|null $faq_html
|
|
|
- * @property \Illuminate\Support\Carbon|null $created_at
|
|
|
- * @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
- * @property \Illuminate\Support\Carbon|null $deleted_at
|
|
|
+ * @property int $id
|
|
|
+ * @property string $name
|
|
|
+ * @property array $image_list
|
|
|
+ * @property array $spec 商品的规格
|
|
|
+ * @property int $weight
|
|
|
+ * @property string|null $desc_html
|
|
|
+ * @property string|null $spec_attr_html
|
|
|
+ * @property string|null $faq_html
|
|
|
+ * @property \Illuminate\Support\Carbon|null $created_at
|
|
|
+ * @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
+ * @property \Illuminate\Support\Carbon|null $deleted_at
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Goods newModelQuery()
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Goods newQuery()
|
|
|
* @method static \Illuminate\Database\Query\Builder|Goods onlyTrashed()
|
|
@@ -53,6 +53,8 @@ use Illuminate\Support\Arr;
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Goods whereUrl3d($value)
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Goods\GoodsSpecMap[] $specMap
|
|
|
* @property-read int|null $spec_map_count
|
|
|
+ * @property array $custom
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|Goods whereCustom($value)
|
|
|
*/
|
|
|
class Goods extends BaseModel
|
|
|
{
|
|
@@ -64,6 +66,7 @@ class Goods extends BaseModel
|
|
|
protected $casts = [
|
|
|
"image_list" => "array",
|
|
|
"spec" => "array",
|
|
|
+ "custom" => "array",
|
|
|
];
|
|
|
|
|
|
public function format(...$options)
|
|
@@ -76,11 +79,6 @@ class Goods extends BaseModel
|
|
|
return $this->hasMany(GoodsCategoryMap::class, "goods_id", "id");
|
|
|
}
|
|
|
|
|
|
- public function sku()
|
|
|
- {
|
|
|
- return $this->hasMany(GoodsSku::class, "goods_id", "id");
|
|
|
- }
|
|
|
-
|
|
|
public function getThumbAttribute()
|
|
|
{
|
|
|
return Arr::first($this->image_list);
|