From 0f081c90a3bf728f2d3285c9dc67516a9134c855 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 10 Dec 2019 15:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=94=AE=E5=90=8E=E5=92=8C?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=95=86=E5=93=81=E8=A1=A8=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/shop/models/ars/AfterSale.php | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/backend/modules/shop/models/ars/AfterSale.php b/backend/modules/shop/models/ars/AfterSale.php index 5adc1c1..6a1a70b 100755 --- a/backend/modules/shop/models/ars/AfterSale.php +++ b/backend/modules/shop/models/ars/AfterSale.php @@ -4,6 +4,7 @@ namespace backend\modules\shop\models\ars; use Yii; use yii\behaviors\TimestampBehavior; +use backend\modules\shop\models\ars\OrderGoods; /** * This is the model class for table "ats_after_sale". @@ -30,6 +31,7 @@ use yii\behaviors\TimestampBehavior; */ class AfterSale extends \yii\db\ActiveRecord { + public $order_pay_amount; //订单支付金额 //退款类型 const REFUND_TYPE_ALL = 1; //全额退款 const REFUND_TYPE_PART = 2; //部分退款 @@ -42,7 +44,24 @@ class AfterSale extends \yii\db\ActiveRecord const STATUS_CANCEL = 5; //已取消 //退款方式 const REFUND_MODE_MONEY = 1; //仅退款 - const REFUND_MODE_MONEY_GOODS = 2; + const REFUND_MODE_MONEY_GOODS = 2; //退货退款 + + public static $refundType = [ + self::REFUND_TYPE_ALL => '全额退款', + self::REFUND_TYPE_PART => '部分退款' + ]; + public static $status = [ + self::STATUS_UNTREATED => '未处理', + self::STATUS_ACCEPT => '已同意,待买家确认', + self::STATUS_CONFIRM => '用户已确认', + self::STATUS_REJECT => '已拒绝', + self::STATUS_FINISH => '退款成功', + self::STATUS_CANCEL => '已取消' + ]; + public static $refundMode = [ + self::REFUND_MODE_MONEY => '仅退款', + self::REFUND_MODE_MONEY_GOODS => '退货退款' + ]; /** * {@inheritdoc} */ @@ -76,7 +95,7 @@ class AfterSale extends \yii\db\ActiveRecord 'user_id' => '用户id', 'order_goods_id' => '订单商品id', 'amount' => '退货时实际退的金额', - 'count' => '退换货的商品数量', + 'count' => '退货的商品数量', 'apply_at' => '申请时间', 'dealt_at' => '处理时间', 'finish_at' => '完成时间', @@ -91,6 +110,11 @@ class AfterSale extends \yii\db\ActiveRecord 'refund_mode' => '退款方式', ]; } + + public function getGoods() + { + return $this->hasOne(OrderGoods::className(), ['id' => 'order_goods_id']); + } }