链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
796 B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Laravel\Scout\Searchable;
  5. class LanzuGoods extends Model
  6. {
  7. use Searchable;
  8. protected $table = 'lanzu_goods';
  9. protected $dateFormat = 'U';
  10. public function searchableAs()
  11. {
  12. return 'lanzu-goods-test';
  13. }
  14. public function toSearchableArray()
  15. {
  16. return [
  17. 'name' => $this->name,
  18. 'market_id' => $this->market_id,
  19. 'store_id' => $this->store_id,
  20. ];
  21. }
  22. /**
  23. * 指定 搜索索引中存储的唯一ID
  24. * @return mixed
  25. */
  26. public function getScoutKey()
  27. {
  28. return $this->id;
  29. }
  30. /**
  31. * 指定 搜索索引中存储的唯一ID的键名
  32. * @return string
  33. */
  34. public function getScoutKeyName()
  35. {
  36. return 'id';
  37. }
  38. }