| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%order_invoice}}".
- *
- * @property integer $id
- */
- class OrderInvoice extends \yii\db\ActiveRecord
- {
-
- const STATUS_DEFAULT = 0;//待开票
- const STATUS_FINISH = 1;//已开票
- const STATUS_REJECT = 2;//已拒绝
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%order_invoice}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- ]
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- if($insert){
- SaasUserInvoiceConf::saveOrderInvoiceConf($this);
- }
- }
- public function getOrder()
- {
- return $this->hasOne(Order::className(), ['id' => 'order_id']);
- }
- public function getUser()
- {
- return $this->hasOne(User::className(), ['id'=>'user_id']);
- }
- }
|