Files
xk-api-yii/common/models/OrderVideoInfo.php
2024-09-19 11:32:39 +08:00

27 lines
644 B
PHP

<?php
namespace common\models;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class OrderVideoInfo extends \common\modelsgii\OrderVideoInfo
{
public function behaviors()
{
return [
[
'class' => TimestampBehavior::class,
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
],
],
];
}
public function getOrder()
{
return $this->hasOne(Order::className(), ['id' => 'order_id']);
}
}