| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- class DeliveryMaiyatian extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%delivery_maiyatian}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
- ]
- ]
- ];
- }
-
- public function getRefundStatusName() {
- $res = '';
- if($this->is_refund == 2){
- $res = '退款已完成';
- }
- if($this->is_refund == 1){
- $res = '退款已申请';
- }
- if($this->refund_status == 1){
- $res = '退款已同意';
- }
- if($this->refund_status == 2){
- $res = '退款已拒绝';
- }
- return $res;
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes);
- if(!$insert){
- $order = Order::findOne(['order_no' => $this->order_no]);
- \app\modules\admin\models\WastoreForm::afterDeliveryChange($this->store_id, $order);
- }
- }
- }
|