LiveRoomGoodsModel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model\Arts;
  4. use App\Master\Framework\Library\Tencent\TencentIm;
  5. use App\Model\Model;
  6. class LiveRoomGoodsModel extends Model
  7. {
  8. /**
  9. * The table associated with the model.
  10. *
  11. * @var ?string
  12. */
  13. protected ?string $table = 'live_room_goods';
  14. protected ?string $dateFormat = 'U';
  15. public bool $timestamps = false;
  16. protected int $is_status_search = 0;// 是否使用 1=是 0=否 默认使用 status = 1 筛选
  17. protected int $is_delete_search = 0;// 是否使用 1=是 0=否 默认使用 is_delete = 0 筛选
  18. /**
  19. * 默认查询字段
  20. *
  21. * @var array|string[]
  22. */
  23. public array $select = [
  24. '*'
  25. ];
  26. public function searchRoomNoAttribute($query, $value, array $params): mixed
  27. {
  28. if (empty($value)) {
  29. return $query;
  30. }
  31. return $query->where('room_no', $value);
  32. }
  33. public function searchAdminIdAttribute($query, $value, array $params): mixed
  34. {
  35. if (empty($value)) {
  36. return $query;
  37. }
  38. return $query->where('admin_id', $value);
  39. }
  40. }