TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'] ] ] ]; } /** * @inheritdoc */ public function rules() { return [ [['id', 'user_id', 'goods_id', 'order_id', 'created_at', 'updated_at', 'is_switch'], 'integer'], [['goods_price', 'goods_profit'], 'number'] ]; } }