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']); + } }