| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "{{%q_and_a_cat}}".
- *
- * @property int $id
- * @property int $store_id
- * @property int $is_delete
- * @property string $name
- * @property int $created_at
- * @property int $updated_at
- * @property int $sort
- * @property int $state
- */
- class QAndACat extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%q_and_a_cat}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
- ]
- ]
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['name', 'store_id', 'sort', 'state'], 'required'],
- [['store_id', 'name', 'created_at', 'is_delete', 'updated_at'], 'safe']
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'name' => '名称',
- 'created_at' => '添加时间',
- 'is_delete' => '是否删除',
- 'updated_at' => 'Update Time',
- ];
- }
- }
|