SaasLivePlan.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\model\saas;
  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 $poi_id 门店ID
  9. * @property string $plan_name
  10. * @property string $merchant_phone
  11. * @property integer $status
  12. * @property mixed $create_at
  13. */
  14. class SaasLivePlan 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_live_plan";
  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 goods(): HasMany
  41. {
  42. return $this->hasMany(SaasLivePlanGoods::class,'plan_id','plan_id');
  43. }
  44. public function star(): HasMany
  45. {
  46. return $this->hasMany(SaasLivePlanStar::class,'plan_id','plan_id');
  47. }
  48. public function poi(): HasOne
  49. {
  50. return $this->hasOne(SaasStore::class,'poi_id','poi_id');
  51. }
  52. }