SaasChatStore.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\model\saas;
  3. use app\extra\basic\Model;
  4. use app\model\system\SystemUser;
  5. use think\model\relation\HasMany;
  6. use think\model\relation\HasOne;
  7. /**
  8. * @property integer $id (主键)
  9. * @property mixed $openid
  10. * @property mixed $poi_id 店铺ID
  11. * @property string $poi_name 店铺名称
  12. * @property mixed $create_at
  13. */
  14. class SaasChatStore extends Model
  15. {
  16. /**
  17. * The connection name for the model.
  18. *
  19. * @var string|null
  20. */
  21. protected $connection = 'mysql';
  22. /**
  23. * The table associated with the model.
  24. *
  25. * @var string
  26. */
  27. protected string $table = "saas_chat_store";
  28. /**
  29. * The primary key associated with the table.
  30. *
  31. * @var string
  32. */
  33. protected string $primaryKey = "id";
  34. /**
  35. * Indicates if the model should be timestamped.
  36. *
  37. * @var bool
  38. */
  39. public bool $timestamps = false;
  40. public function user(): HasOne
  41. {
  42. return $this->hasOne(SaasUserOpen::class,"openid","openid");
  43. }
  44. public function nick(): HasOne
  45. {
  46. return $this->hasOne(SystemUser::class,"id","service_id");
  47. }
  48. public function orders(): HasOne
  49. {
  50. return $this->hasOne(SaasOrder::class,"order_sn","order");
  51. }
  52. public function good(): HasOne
  53. {
  54. return $this->hasOne(SaasGoods::class,"product_id","goods");
  55. }
  56. }