WalletLogStringCode.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\behaviors\TimestampBehavior;
  9. use yii\db\ActiveRecord;
  10. /**
  11. * This is the model class for table "{{%wallet_log_string_code}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $order_id
  16. * @property integer $user_id
  17. * @property integer $saas_id
  18. * @property integer $type
  19. * @property integer $source
  20. * @property string $money
  21. * @property integer $is_delete
  22. * @property integer $created_at
  23. * @property integer $order_type
  24. * @property string $version
  25. * @property string $desc
  26. */
  27. class WalletLogStringCode extends \yii\db\ActiveRecord
  28. {
  29. public static function tableName()
  30. {
  31. return '{{%wallet_log_string_code}}';
  32. }
  33. public function behaviors()
  34. {
  35. return [
  36. [
  37. 'class' => TimestampBehavior::class,
  38. 'attributes' => [
  39. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  40. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  41. ]
  42. ]
  43. ];
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function rules()
  49. {
  50. return [
  51. [['store_id', 'user_id', 'money', 'before_money'], 'required'],
  52. [['id', 'store_id', 'user_id', 'saas_id', 'source_id', 'created_at', 'updated_at'], 'integer'],
  53. [['money', 'before_money'], 'number'],
  54. [['type'], 'string', 'max' => 32],
  55. [['currency_code', 'source_table'], 'string', 'max' => 64],
  56. [['desc'], 'string', 'max' => 255],
  57. [['extra'], 'string']
  58. ];
  59. }
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public function attributeLabels()
  64. {
  65. return [
  66. 'id' => 'ID',
  67. 'store_id' => '商城ID',
  68. 'user_id' => '用户ID',
  69. 'saas_id' => '联盟ID',
  70. 'currency_code' => '货币代码',
  71. 'money' => '资金变动(支持负数)',
  72. 'before_money' => '变动前金额',
  73. 'type' => '类型',
  74. 'source_table' => '关联表',
  75. 'source_id' => '关联表id',
  76. 'desc' => '描述',
  77. 'extra' => '额外信息',
  78. 'created_at' => '创建时间',
  79. 'updated_at' => '更新时间',
  80. ];
  81. }
  82. public function getUser()
  83. {
  84. return $this->hasOne(User::class, ['id' => 'user_id']);
  85. }
  86. }