BlueExpert.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 string $truenname
  10. * @property string $mobile
  11. * @property string $idcard
  12. * @property string $city
  13. * @property mixed $city_path
  14. * @property integer $sex 1男2女
  15. * @property integer $married 1已婚2未
  16. * @property integer $child 1有2无
  17. * @property mixed $create_at 创建时间
  18. */
  19. class BlueExpert extends Model
  20. {
  21. /**
  22. * The connection name for the model.
  23. *
  24. * @var string|null
  25. */
  26. protected $connection = 'mysql';
  27. /**
  28. * The table associated with the model.
  29. *
  30. * @var string
  31. */
  32. protected string $table = "blue_expert";
  33. /**
  34. * The primary key associated with the table.
  35. *
  36. * @var string
  37. */
  38. protected string $primaryKey = "id";
  39. /**
  40. * Indicates if the model should be timestamped.
  41. *
  42. * @var bool
  43. */
  44. public bool $timestamps = false;
  45. public function open(): HasOne
  46. {
  47. return $this->hasOne(BlueUserOpen::class,"openid","openid");
  48. }
  49. public function platform(): HasMany
  50. {
  51. return $this->hasMany(BlueExpertPlatform::class,"openid","openid");
  52. }
  53. }