Files
datahub/backend/app/Model/Product.php
T
2026-02-06 10:59:24 +08:00

101 lines
2.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
/**
* @property int $id 主键
* @property int $company_id 公司 ID
* @property int $platform_id 平台 ID
* @property int $store_id 店铺 ID
* @property int $status_id 产品状态 ID
* @property int $type_id 产品类型 ID
* @property int|null $warehouse_id 仓库 ID
* @property int|null $sub_warehouse_id 子仓库 ID
* @property string $platform_item_id 平台商品 ID
* @property string|null $platform_model_id 平台规格 ID
* @property string|null $origin_sku_id 品牌方原始 SKU ID
* @property string|null $mapped_sku_id 映射后的 SKU ID
* @property string|null $barcode 条形码
* @property string|null $hscode 海关货物编码
* @property array|null $bundled 组合商品信息
* @property string $price 售价
* @property string $currency 货币代码
* @property int $num 可售卖数量
* @property string|null $url 平台 URL
* @property string|null $picture 图片链接
* @property string $hash raw 字段的 MD5 哈希值
* @property string|null $name 商品名称
* @property array $raw 平台返回的原始产品信息
* @property array|null $ext 扩展字段
* @property \Carbon\Carbon|null $created_date 商品在平台的创建时间
* @property \Carbon\Carbon|null $updated_date 商品在平台的更新时间
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*/
class Product extends Model
{
/**
* The table associated with the model.
*/
protected ?string $table = 'products';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = [
'id',
'company_id',
'platform_id',
'store_id',
'status_id',
'type_id',
'warehouse_id',
'sub_warehouse_id',
'platform_item_id',
'platform_model_id',
'origin_sku_id',
'mapped_sku_id',
'barcode',
'hscode',
'bundled',
'price',
'currency',
'num',
'url',
'picture',
'hash',
'name',
'raw',
'ext',
'created_date',
'updated_date',
'created_at',
'updated_at',
];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = [
'id' => 'integer',
'company_id' => 'integer',
'platform_id' => 'integer',
'store_id' => 'integer',
'status_id' => 'integer',
'type_id' => 'integer',
'warehouse_id' => 'integer',
'sub_warehouse_id' => 'integer',
'price' => 'decimal:2',
'num' => 'integer',
'bundled' => 'json',
'raw' => 'json',
'ext' => 'json',
'created_date' => 'datetime',
'updated_date' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
}