| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace App\Models;
- use DateTimeInterface;
- use Illuminate\Database\Eloquent\Model;
- /**
- * 商家商品规格表
- *
- * @property int $id 商品规格表
- * @property int $goods_id 商品id
- * @property string|null $sku_name 规格名称
- * @property int $sku_type 1:单选, 2:多选
- * @property int $affect_quantity 是否影响购物车数量: 0-不影响, 1-影响
- * @property int $is_del 是否删除
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku query()
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereAffectQuantity($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereGoodsId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereIsDel($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereSkuName($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereSkuType($value)
- * @method static \Illuminate\Database\Eloquent\Builder|GoodsSku whereUpdatedAt($value)
- * @mixin \Eloquent
- */
- class GoodsSku extends Model
- {
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected $table = 'goods_sku';
- /**
- * The primary key associated with the table.
- *
- * @var string
- */
- protected $primaryKey = 'id';
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public $timestamps = true;
- /**
- * 不能被批量赋值的属性
- *
- * @var array
- */
- protected $guarded = ['id', 'updated_at', 'created_at'];
- /**
- * 为数组 / JSON 序列化准备日期。
- *
- * @param DateTimeInterface $date
- * @return string
- */
- protected function serializeDate(DateTimeInterface $date)
- {
- return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
- }
- }
|