MchCash.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. use yii\behaviors\TimestampBehavior;
  10. /**
  11. * This is the model class for table "{{%mch_cash}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $mch_id
  16. * @property string $money
  17. * @property string $order_no
  18. * @property integer $status
  19. * @property integer $type
  20. * @property string $type_data
  21. * @property integer $virtual_type
  22. * @property string $created_at
  23. * @property string $updated_at
  24. */
  25. class MchCash extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * @inheritdoc
  29. */
  30. public static function tableName()
  31. {
  32. return '{{%mch_cash}}';
  33. }
  34. public function behaviors()
  35. {
  36. return [
  37. [
  38. // 自动更新创建和更新时间
  39. 'class' => TimestampBehavior::class,
  40. 'value' => time()
  41. ]
  42. ];
  43. }
  44. /**
  45. * @inheritdoc
  46. */
  47. public function rules()
  48. {
  49. return [
  50. [['store_id', 'mch_id', 'money', 'order_no'], 'required'],
  51. [['store_id', 'mch_id', 'status', 'created_at', 'updated_at', 'type', 'virtual_type'], 'integer'],
  52. [['money'], 'number'],
  53. [['order_no', 'type_data'], 'string', 'max' => 255],
  54. ];
  55. }
  56. /**
  57. * @inheritdoc
  58. */
  59. public function attributeLabels()
  60. {
  61. return [
  62. 'id' => 'ID',
  63. 'store_id' => 'Store ID',
  64. 'mch_id' => 'Mch ID',
  65. 'money' => 'Money',
  66. 'order_no' => 'Order No',
  67. 'status' => '提现状态:0=待处理,1=已转账,2=已拒绝',
  68. 'type' => '提现类型 0--微信自动打款 1--微信线下打款 2--支付宝线下打款 3--银行卡线下打款 4--充值到余额',
  69. 'type_data' => '不同提现类型,提交的数据',
  70. 'virtual_type' => '实际上打款方式',
  71. 'created_at' => '创建时间',
  72. 'updated_at' => '更新时间',
  73. ];
  74. }
  75. public function getMch()
  76. {
  77. return $this->hasMany(Mch::className(), ['id' => 'mch_id']);
  78. }
  79. }