| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\jobs\storeSync\DiyCommon;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "{{%topic_type}}".
- *
- * @property int $id
- * @property int|null $store_id
- * @property string|null $name
- * @property string|null $desc
- * @property int|null $sort
- * @property int|null $is_delete
- * @property int|null $created_at 添加时间
- * @property int|null $updated_at 更新时间
- * @property int $type
- */
- class AboutArticle extends \yii\db\ActiveRecord
- {
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%about_article}}';
- }
- 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 [
- [['sort', 'is_delete', 'store_id', 'created_at', 'updated_at', 'type'], 'integer'],
- [['name'], 'string', 'max' => 255],
- [['desc'], 'string']
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Name',
- 'desc' => '文章详情',
- 'sort' => 'Sort',
- 'is_delete' => 'Is Delete',
- 'store_id' => 'Store ID',
- 'created_at' => 'created_at',
- 'updated_at' => 'updated_at',
- 'type' => '文章类型'
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
- (new DiyCommon)->JobBehaviors($this->store_id, StoreSyncExtLog::TYPE_ARTICLE);
- }
- }
|