| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- /**
- * This is the model class for table "{{%card}}".
- *
- * @property int $id
- * @property int|null $store_id
- * @property string $name 卡券名称
- * @property string $pic_url
- * @property string|null $content 卡券描述
- * @property int $is_delete
- * @property int|null $updated_at
- * @property int|null $created_at
- */
- class Card extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%card}}';
- }
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- 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 [
- [['store_id', 'is_delete', 'updated_at', 'created_at'], 'integer'],
- [['name', 'pic_url', 'is_delete'], 'required'],
- [['content'], 'string'],
- [['name'], 'string', 'max' => 255],
- [['pic_url'], 'string', 'max' => 2048],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'name' => '卡券名称',
- 'pic_url' => 'Pic Url',
- 'content' => '卡券描述',
- 'is_delete' => 'Is Delete',
- 'updated_at' => 'Update Time',
- 'created_at' => 'Add Time',
- ];
- }
- }
|