Purchase.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. use Yii;
  11. /**
  12. * This is the model class for table "{{%purchase}}".
  13. *
  14. * @property int $id
  15. * @property int $store_cloud_id 商户id
  16. * @property string $name 姓名
  17. * @property int $mobile 手机号
  18. * @property string $custom_data 自定义表单数据
  19. * @property int $saas_user_id 联盟用户id
  20. * @property int $status 状态
  21. * @property int $created_at 创建时间
  22. * @property int $updated_at 更新时间
  23. * @property int $is_delete 是否删除
  24. * @property integer $district_id
  25. * @property integer $city_id
  26. * @property integer $province_id
  27. */
  28. class Purchase extends \yii\db\ActiveRecord
  29. {
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public static function tableName()
  34. {
  35. return '{{%purchase}}';
  36. }
  37. public function behaviors()
  38. {
  39. return [
  40. [
  41. 'class' => TimestampBehavior::class,
  42. 'attributes' => [
  43. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  44. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  45. ]
  46. ]
  47. ];
  48. }
  49. /**
  50. * {@inheritdoc}
  51. */
  52. public function rules()
  53. {
  54. return [
  55. [['store_cloud_id', 'is_delete', 'created_at', 'updated_at', 'status', 'saas_user_id', 'district_id', 'city_id', 'province_id'], 'integer'],
  56. [['name', 'mobile', 'saas_user_id'], 'required'],
  57. [['name'], 'string', 'max' => 255],
  58. [['status'], 'default', 'value' => 0],
  59. [['custom_data'], 'string'],
  60. ];
  61. }
  62. /**
  63. * {@inheritdoc}
  64. */
  65. public function attributeLabels()
  66. {
  67. return [
  68. 'id' => 'ID',
  69. 'store_cloud_id' => '商户id',
  70. 'name' => '充值名称',
  71. 'mobile' => '手机号',
  72. 'custom_data' => '自定义数据',
  73. 'saas_user_id' => '联盟用户id',
  74. 'created_at' => '添加时间',
  75. 'updated_at' => '更新时间',
  76. 'status' => '状态, 0:待审核, 1:已通过, 2:已拒绝',
  77. 'is_delete' => '是否删除',
  78. 'district_id' => '区',
  79. 'city_id' => '市',
  80. 'province_id' => '省',
  81. ];
  82. }
  83. }