| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\jobs\storeSync\DiyCommon;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%saas_integral_cat}}".
- *
- * @property integer $id
- * @property string $name
- * @property integer $store_id
- * @property integer $is_enable
- * @property integer $is_delete
- * @property integer $created_at
- * @property integer $updated_at
- */
- class NewIntegralCat extends \yii\db\ActiveRecord
- {
- /**
- * 删除状态:已删除
- */
- const DELETE_STATUS_TRUE = 1;
- /**
- * 删除状态:未删除
- */
- const DELETE_STATUS_FALSE = 0;
- /**
- * 禁用状态:已禁用
- */
- const IS_ENABLE_FALSE = 0;
- /**
- * 禁用状态:未禁用
- */
- const IS_ENABLE_TRUE= 1;
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%new_integral_cat}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['is_delete', 'is_enable', 'store_id'], 'integer'],
- [['name'], 'string', 'max' => 32],
- ];
- }
- 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 attributeLabels()
- {
- return [
- 'id' => '分类ID',
- 'store_id' => '商城id',
- 'name' => '分类名称',
- 'is_delete' => 'Is Delete',
- 'is_enable' => '状态',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- 'sort' => '排序'
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
- (new DiyCommon)->JobBehaviors($this->store_id, StoreSyncExtLog::TYPE_INTEGRAL_STORE);
- }
- }
|