MdSetting.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * MdSetting.php
  4. * 门店设置信息表
  5. * Created on 2024/3/18 14:12
  6. * @author: hankaige
  7. */
  8. namespace app\models;
  9. use yii\behaviors\TimestampBehavior;
  10. use yii\db\ActiveRecord;
  11. /**
  12. * This is the model class for table "{{%md_setting}}".
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $change_shop
  16. * @property integer $pay_wechat
  17. * @property integer $pay_alipay
  18. * @property integer $pay_bank
  19. * @property integer $pay_remaining
  20. * @property float $min_money
  21. * @property float $cash_max_day
  22. * @property float $cash_max_single_day
  23. * @property float $cash_service_charge
  24. * @property integer $created_at
  25. * @property integer $updated_at
  26. * @property integer $is_delete
  27. */
  28. class MdSetting extends \yii\db\ActiveRecord
  29. {
  30. /**
  31. * @inheritdoc
  32. */
  33. public static function tableName()
  34. {
  35. return '{{%md_setting}}';
  36. }
  37. public function behaviors()
  38. {
  39. return [
  40. [
  41. 'class' => TimestampBehavior::class,
  42. 'attributes' => [
  43. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  44. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  45. ]
  46. ]
  47. ];
  48. }
  49. public function rules()
  50. {
  51. return [
  52. [
  53. ['store_id'],
  54. 'required'
  55. ],
  56. [
  57. [
  58. 'store_id',
  59. 'change_shop',
  60. 'pay_wechat',
  61. 'pay_alipay',
  62. 'pay_bank',
  63. 'pay_remaining',
  64. 'created_at',
  65. 'updated_at',
  66. 'is_delete'
  67. ],
  68. 'integer'
  69. ],
  70. [
  71. [
  72. 'pay_alipay',
  73. 'pay_bank',
  74. 'pay_remaining',
  75. 'updated_at',
  76. 'is_delete'
  77. ],
  78. 'default',
  79. 'value' => 0
  80. ],
  81. [
  82. [
  83. 'pay_wechat',
  84. 'change_shop'
  85. ],
  86. 'default',
  87. 'value' => 1
  88. ],
  89. [
  90. [
  91. 'min_money',
  92. 'cash_max_day',
  93. 'cash_max_single_day',
  94. 'cash_service_charge'
  95. ],
  96. 'number'
  97. ],
  98. [
  99. [
  100. 'min_money',
  101. 'cash_max_day',
  102. 'cash_max_single_day',
  103. 'cash_service_charge'
  104. ],
  105. 'default',
  106. 'value' => 0
  107. ]
  108. ];
  109. }
  110. public function attributeLabels()
  111. {
  112. return [
  113. 'store_id' => '商城ID',
  114. 'change_shop' => '门店切换',
  115. 'pay_wechat' => '微信提现',
  116. 'pay_alipay' => '支付宝提现',
  117. 'pay_bank' => '银行卡提现',
  118. 'pay_remaining' => '余额提现',
  119. 'created_at' => '创建时间',
  120. 'updated_at' => '更新时间',
  121. 'is_delete' => '删除时间',
  122. 'min_money' => '每次最小提现金额',
  123. 'cash_max_day' => '每天提现金额',
  124. 'cash_max_single_day' => '没人单日提现金额',
  125. 'cash_service_charge' => '提现手续费'
  126. ];
  127. }
  128. }