初始化仓库
This commit is contained in:
26
common/models/OrderRefund.php
Normal file
26
common/models/OrderRefund.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class OrderRefund extends \common\modelsgii\OrderRefund
|
||||
{
|
||||
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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user