EventUser.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "cyy_event_user".
  7. *
  8. * @property int $id
  9. * @property int|null $store_id 商城ID
  10. * @property int|null $created_at
  11. * @property int|null $updated_at
  12. * @property int|null $is_delete 是否删除:0=否;1=是;
  13. * @property int|null $event_id 活动ID
  14. * @property int|null $user_id 参会人用户ID
  15. * @property string|null $company_code 统一社会信息代码
  16. * @property string|null $company_name 公司名称
  17. * @property int|null $apply_status 审核状态:0=待审核;1=已通过;2=已驳回;
  18. * @property int|null $apply_time 审核时间
  19. * @property string|null $reason_refusal 拒绝原因
  20. * @property int|null $sign_time 首次签到时间
  21. * @property int|null $form_type 表单类型:1=企业;2=机构;
  22. */
  23. class EventUser extends \yii\db\ActiveRecord
  24. {
  25. const APPLY_PENDING = 0;
  26. const APPLY_APPROVED = 1;
  27. const APPLY_REJECTED = 2;
  28. public static function tableName()
  29. {
  30. return 'cyy_event_user';
  31. }
  32. public function behaviors()
  33. {
  34. return [
  35. [
  36. // 自动更新创建和更新时间
  37. 'class' => TimestampBehavior::class,
  38. 'value' => time()
  39. ]
  40. ];
  41. }
  42. public function rules()
  43. {
  44. return [
  45. [['store_id', 'created_at', 'updated_at', 'event_id', 'user_id', 'apply_status', 'apply_time', 'sign_time', 'form_type', 'is_delete'], 'integer'],
  46. [['company_code', 'company_name', 'company_address', 'real_name', 'phone', 'identity_card', 'reason_refusal'], 'string', 'max' => 255],
  47. [['hotel', 'restaurant', 'itinerary'], 'string'],
  48. [['event_id', 'user_id', 'real_name', 'phone'], 'required'],
  49. [['apply_status'], 'in', 'range' => [self::APPLY_PENDING, self::APPLY_APPROVED, self::APPLY_REJECTED]],
  50. ];
  51. }
  52. public function attributeLabels()
  53. {
  54. return [
  55. 'id' => 'ID',
  56. 'store_id' => '商城ID',
  57. 'created_at' => '创建时间',
  58. 'updated_at' => '更新时间',
  59. 'is_delete' => '是否删除',
  60. 'event_id' => '活动ID',
  61. 'user_id' => '用户ID',
  62. 'company_code' => '统一信用代码',
  63. 'company_name' => '公司名称',
  64. 'company_address' => '公司地址',
  65. 'real_name' => '姓名',
  66. 'phone' => '手机号',
  67. 'identity_card' => '身份证号',
  68. 'hotel' => '住宿信息',
  69. 'restaurant' => '餐食信息',
  70. 'itinerary' => '行程信息',
  71. 'apply_status' => '审核状态',
  72. 'apply_time' => '审核时间',
  73. 'reason_refusal' => '拒绝原因',
  74. 'sign_time' => '首次签到时间',
  75. 'form_type' => '表单类型:1=企业;2=机构;'
  76. ];
  77. }
  78. }