| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace app\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "cyy_event_form".
- *
- * @property int $id
- * @property int|null $store_id
- * @property int|null $event_id 活动ID
- * @property int|null $form_type 表单类型:1=企业;2=机构;
- * @property string|null $name 名称
- * @property string|null $type 类型
- * @property int|null $required 必填项
- * @property string|null $default 默认值
- * @property string|null $tip 提示语
- * @property int|null $sort 排序
- * @property int|null $is_delete
- * @property int|null $created_at
- * @property int|null $updated_at
- */
- class EventForm extends \yii\db\ActiveRecord
- {
- //表单类型:企业
- const FORM_TYPE_COMPANY = 1;
- //表单类型:机构
- const FORM_TYPE_INSTITUTION = 2;
- //是否必填:否
- const IS_REQUIRED_FALSE = 0;
- //是否必填:是
- const IS_REQUIRED_TRUE = 1;
- public static function tableName()
- {
- return 'cyy_event_form';
- }
- public function behaviors()
- {
- return [
- [
- // 自动更新创建和更新时间
- 'class' => TimestampBehavior::class,
- 'value' => time()
- ]
- ];
- }
- public function rules()
- {
- return [
- [['store_id', 'event_id', 'form_type', 'required', 'sort', 'is_delete', 'created_at', 'updated_at'], 'integer'],
- [['name', 'type', 'default', 'tip'], 'string', 'max' => 255],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => '商城ID',
- 'event_id' => '活动ID',
- 'form_type' => '表单类型:1=企业;2=机构;',
- 'name' => '字段名称',
- 'type' => '字段类型',
- 'required' => '是否必填',
- 'default' => '默认值',
- 'tip' => '提示语',
- 'sort' => '排序',
- 'is_delete' => '是否删除',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- ];
- }
- }
|