SaasChatStore.php 1.4 KB

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