LiveReportModel.php 985 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model\Arts;
  4. use App\Master\Enum\RedisKeyEnum;
  5. use App\Master\Framework\Library\Tencent\TencentIm;
  6. use App\Model\Model;
  7. use App\Utils\RedisUtil;
  8. use Hyperf\DbConnection\Db;
  9. class LiveReportModel extends Model
  10. {
  11. /**
  12. * The table associated with the model.
  13. *
  14. * @var ?string
  15. */
  16. protected ?string $table = 'live_report';
  17. protected ?string $dateFormat = 'U';
  18. public bool $timestamps = false;
  19. protected int $is_status_search = 1;// 是否使用 1=是 0=否 默认使用 status = 1 筛选
  20. protected int $is_delete_search = 0;// 是否使用 1=是 0=否 默认使用 is_delete = 0 筛选
  21. /**
  22. * 默认查询字段
  23. *
  24. * @var array|string[]
  25. */
  26. public array $select = [
  27. '*'
  28. ];
  29. public function add(int $user_id,array $data)
  30. {
  31. $data['user_id'] = $user_id;
  32. $data['create_time'] = time();
  33. return $this->query()->insert($data);
  34. }
  35. }