| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%seckill_activity_order_log}}".
- *
- * @property integer $id
- * @property integer $order_id
- * @property integer $order_detail_id
- * @property integer $user_id
- * @property float $sale_price
- * @property integer $activity_id
- * @property integer $activity_goods_id
- * @property integer $num
- * @property integer $created_at
- * @property integer $updated_at
- * @property integer $is_delete
- * @property integer $store_id
- * @property integer $goods_id
- */
- class SeckillActivityOrderLog extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%seckill_activity_order_log}}';
- }
- 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', 'order_id', 'order_detail_id', 'store_id', 'is_delete', 'activity_id', 'activity_goods_id', 'user_id', 'num', 'goods_id'], 'integer'],
- [['sale_price'], 'number'],
- [['created_at', 'updated_at'], 'safe']
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'order_id' => '订单ID',
- 'order_detail_id' => '订单详情ID',
- 'user_id' => '用户ID',
- 'sale_price' => '销售金额',
- 'activity_id' => '活动ID',
- 'activity_goods_id' => '活动商品ID',
- 'num' => '购买数量',
- 'created_at' => '创建时间',
- 'updated_at' => '修改时间',
- 'is_delete' => '是否删除',
- 'store_id' => '商城ID',
- 'goods_id' => '商品id'
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes);
- if($insert){
- (new \app\utils\OrderUtil())->seckillActivityOrder($this);
- }
- }
- }
|