SaasShop.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 integer $agent_id
  9. * @property string $shop_name
  10. * @property string $start_at
  11. * @property string $end_at 营业时间-结束
  12. * @property string $shop_address 地址
  13. * @property mixed $rule 收费规则
  14. * @property integer $rate_type
  15. * @property integer $rate_radio
  16. * @property integer $rate_money
  17. * @property mixed $vip_end VIP到期时间
  18. * @property string $shop_notice 公告
  19. * @property integer $is_deleted
  20. * @property integer $shop_status 1营业2休息
  21. * @property string $shop_contact 联系人
  22. * @property string $shop_mobile 联系电话
  23. * @property integer $user_card 充值套餐0默认1自定义
  24. * @property mixed $user_card_price 会员卡充值套餐自定义金额
  25. * @property integer $balance
  26. * @property integer $total_balance
  27. * @property float $cash_rate 提现费率
  28. * @property integer $status 0正常1到期2冻结
  29. * @property mixed $line_time 最后在线时间
  30. * @property mixed $create_at
  31. */
  32. class SaasShop extends Model
  33. {
  34. /**
  35. * The connection name for the model.
  36. *
  37. * @var string|null
  38. */
  39. protected $connection = 'mysql';
  40. /**
  41. * The table associated with the model.
  42. *
  43. * @var string
  44. */
  45. protected string $table = "saas_shop";
  46. /**
  47. * The primary key associated with the table.
  48. *
  49. * @var string
  50. */
  51. protected string $primaryKey = "id";
  52. /**
  53. * Indicates if the model should be timestamped.
  54. *
  55. * @var bool
  56. */
  57. public bool $timestamps = false;
  58. public function wx(): HasMany
  59. {
  60. return $this->hasMany("app\model\system\SystemUserOpen","shop_id","shop_id");
  61. }
  62. public function card(): HasOne
  63. {
  64. return $this->hasOne("app\model\system\SystemUserBankcard","agent_id","shop_id");
  65. }
  66. }