EavValueModel.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. namespace SixShop\Eav\Model;
  4. use think\Model;
  5. use think\model\concern\SoftDelete;
  6. use think\model\relation\BelongsTo;
  7. /**
  8. * Class SixShop\Eav\Model\EavValueModel
  9. *
  10. * @property float $value_decimal 数值值
  11. * @property int $attribute_id 属性ID
  12. * @property int $entity_id 实体ID
  13. * @property int $id
  14. * @property int $value_int 整数值
  15. * @property string $create_time
  16. * @property string $delete_time
  17. * @property string $update_time
  18. * @property string $value_datetime 日期时间值
  19. * @property string $value_text 文本值
  20. * @property string $value_varchar 字符串值
  21. * @method static \think\db\Query onlyTrashed()
  22. * @method static \think\db\Query withTrashed()
  23. */
  24. class EavValueModel extends Model
  25. {
  26. use SoftDelete;
  27. protected function getOptions(): array
  28. {
  29. return [
  30. 'name' => 'extension_eav_value'
  31. ];
  32. }
  33. public function attribute(): BelongsTo
  34. {
  35. return $this->belongsTo(EavAttributeModel::class, 'attribute_id', 'id');
  36. }
  37. }