| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\jobs\storeSync\DiyCommon;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%seckill_activity_goods}}".
- *
- * @property integer $id
- * @property integer $goods_id
- * @property string $attr
- * @property integer $virtual_sales
- * @property integer $virtual_num
- * @property integer $seckill_num
- * @property float $seckill_price
- * @property integer $store_id
- * @property integer $is_delete
- * @property integer $activity_id
- * @property integer $created_at
- * @property integer $updated_at
- * @property integer $use_attr
- * @property integer $sale_num
- */
- class SeckillActivityGoods extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%seckill_activity_goods}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
- ]
- ]
- ];
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['id', 'goods_id', 'virtual_sales', 'virtual_num', 'seckill_num', 'store_id', 'is_delete', 'activity_id', 'use_attr', 'sale_num'], 'integer'],
- [['attr'], 'string'],
- [['seckill_price'], 'number'],
- [['created_at', 'updated_at', 'virtual_num'], 'safe']
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'goods_id' => '商品ID',
- 'attr' => '商品规格',
- 'virtual_sales' => '虚拟销量',
- 'virtual_num' => '虚拟库存',
- 'seckill_num' => '秒杀数量',
- 'seckill_price' => '秒杀单价',
- 'store_id' => 'Store Id',
- 'is_delete' => 'Is Delete',
- 'activity_id' => '活动ID',
- 'created_at' => '创建时间',
- 'updated_at' => '修改时间',
- 'use_attr' => '是否使用规格',
- 'sale_num' => '销售数量'
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
- (new DiyCommon)->JobBehaviors($this->activity_id, StoreSyncExtLog::TYPE_SECKILL);
- }
- }
|