Event.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.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 "cyy_event".
  12. *
  13. * @property int $id
  14. * @property int|null $store_id 商城ID
  15. * @property int|null $created_at
  16. * @property int|null $updated_at
  17. * @property int|null $is_delete 是否删除:0=否;1=是;
  18. * @property int|null $start_time 开始时间
  19. * @property int|null $end_time 结束时间
  20. * @property int|null $attendance 公司参会人数限制;0=不限制
  21. * @property string|null $company_form 企业报名表单json
  22. * @property string|null $institution_form 机构报名表单json
  23. * @property string|null $cover_pic 活动封面图
  24. */
  25. class Event extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return 'cyy_event';
  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. [['id', 'store_id', 'created_at', 'updated_at', 'is_delete', 'start_time', 'end_time', 'attendance'], 'integer'],
  51. [['name', 'address', 'company_form', 'institution_form'], 'string'],
  52. [['id'], 'unique'], // 主键唯一性
  53. ];
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function attributeLabels()
  59. {
  60. return [
  61. 'id' => 'ID',
  62. 'store_id' => '商城ID',
  63. 'created_at' => '创建时间',
  64. 'updated_at' => '更新时间',
  65. 'is_delete' => '是否删除:0=否;1=是;',
  66. 'name' => '活动名称',
  67. 'address' => '活动地址',
  68. 'start_time' => '开始时间',
  69. 'end_time' => '结束时间',
  70. 'attendance' => '参会人数限制',
  71. 'company_form' => '企业报名表单(JSON)',
  72. 'institution_form' => '机构报名表单(JSON)',
  73. 'cover_pic' => '封面图',
  74. ];
  75. }
  76. }