| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%wechat_menu_config}}".
- *
- * @property integer $id
- * @property string $name
- * @property integer $type
- * @property string $value
- * @property integer $sort
- * @property integer $store_id
- * @property integer $created_at
- * @property integer $update_at
- * @property integer $parent_id
- * @property integer $is_delete
- */
- class WechatMenuConfig extends ActiveRecord
- {
- /**
- * 配置类型
- */
- const TYPE_CONFIG_MINI = 1;
- const TYPE_CONFIG_MP = 2;
- const TYPE_CONFIG_APP = 3;
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%wechat_menu_config}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['id', 'sort', 'store_id', 'created_at', 'update_at', 'parent_id', 'is_delete'], 'integer'],
- [['name', 'store_id'], 'required'],
- [['name', 'value'], 'string']
- ];
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'update_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'update_at'
- ]
- ]
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'type' => '类型,0:链接 1:关键字 2:小程序 3:图文',
- 'value' => '值',
- 'sort' => '排序',
- 'store_id' => '商城id',
- 'parent_id' => '父级id',
- 'name' => '名称',
- 'created_at' => '创建时间',
- 'update_at' => '更新时间',
- 'is_delete' => 'Is Delete',
- ];
- }
- }
|