BlueExpertPlatform.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\model\blue;
  3. use app\extra\basic\Model;
  4. use think\model\relation\HasMany;
  5. use think\model\relation\HasOne;
  6. /**
  7. * @property integer $id (主键)
  8. * @property mixed $openid
  9. * @property mixed $source
  10. */
  11. class BlueExpertPlatform extends Model
  12. {
  13. /**
  14. * The connection name for the model.
  15. *
  16. * @var string|null
  17. */
  18. protected $connection = 'mysql';
  19. /**
  20. * The table associated with the model.
  21. *
  22. * @var string
  23. */
  24. protected string $table = "blue_expert_platform";
  25. /**
  26. * The primary key associated with the table.
  27. *
  28. * @var string
  29. */
  30. protected string $primaryKey = "id";
  31. /**
  32. * Indicates if the model should be timestamped.
  33. *
  34. * @var bool
  35. */
  36. public bool $timestamps = false;
  37. public function user(): HasOne
  38. {
  39. return $this->hasOne(BlueExpert::class,"openid","openid");
  40. }
  41. public function job(): HasMany
  42. {
  43. return $this->hasMany(BlueTaskUser::class,"openid","openid");
  44. }
  45. }