You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.2 KiB

  1. <?php
  2. namespace backend\modules\shop\models\ars;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "ats_after_sale".
  7. *
  8. * @property int $id
  9. * @property string $wx_refund_id 微信退款单号
  10. * @property string $after_sale_sn 售后单号
  11. * @property int $user_id 用户id
  12. * @property int $order_goods_id 订单商品id
  13. * @property int $amount 退货时实际退的金额
  14. * @property int $count 退换货的商品数量
  15. * @property int $apply_at 申请时间
  16. * @property int $dealt_at 处理时间
  17. * @property int $finish_at 完成时间
  18. * @property int $operator_id 操作者
  19. * @property int $refund_type 退款类型:1:全额退款;2:部分退款
  20. * @property string $description 描述
  21. * @property string $image 图片
  22. * @property int $status 处理状态:0:未处理;1:已同意,待买家确认;2:用户已确认;3:已拒绝;4:退款成功;5:已取消;
  23. * @property int $reason 退换货理由
  24. * @property string $remarks 店家备注
  25. * @property string $take_shipping_sn 用户发货物流单号
  26. * @property int $refund_mode 退款方式:1:仅退款;2:退货退款;
  27. */
  28. class AfterSale extends \yii\db\ActiveRecord
  29. {
  30. //退款类型
  31. const REFUND_TYPE_ALL = 1; //全额退款
  32. const REFUND_TYPE_PART = 2; //部分退款
  33. //处理状态
  34. const STATUS_UNTREATED = 0; //未处理
  35. const STATUS_ACCEPT = 1; //已同意,待买家确认
  36. const STATUS_CONFIRM = 2; //用户已确认
  37. const STATUS_REJECT = 3; //已拒绝
  38. const STATUS_FINISH = 4; //退款成功
  39. const STATUS_CANCEL = 5; //已取消
  40. //退款方式
  41. const REFUND_MODE_MONEY = 1; //仅退款
  42. const REFUND_MODE_MONEY_GOODS = 2;
  43. /**
  44. * {@inheritdoc}
  45. */
  46. public static function tableName()
  47. {
  48. return 'ats_after_sale';
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public function rules()
  54. {
  55. return [
  56. [['user_id', 'order_goods_id', 'amount', 'count', 'apply_at', 'dealt_at', 'finish_at', 'operator_id', 'refund_type', 'status', 'reason', 'refund_mode'], 'integer'],
  57. [['description', 'image', 'remarks'], 'string'],
  58. [['wx_refund_id', 'after_sale_sn'], 'string', 'max' => 64],
  59. [['take_shipping_sn'], 'string', 'max' => 50],
  60. ];
  61. }
  62. /**
  63. * {@inheritdoc}
  64. */
  65. public function attributeLabels()
  66. {
  67. return [
  68. 'id' => 'id',
  69. 'wx_refund_id' => '微信退款单号',
  70. 'after_sale_sn' => '售后单号',
  71. 'user_id' => '用户id',
  72. 'order_goods_id' => '订单商品id',
  73. 'amount' => '退货时实际退的金额',
  74. 'count' => '退换货的商品数量',
  75. 'apply_at' => '申请时间',
  76. 'dealt_at' => '处理时间',
  77. 'finish_at' => '完成时间',
  78. 'operator_id' => '操作者',
  79. 'refund_type' => '退款类型',
  80. 'description' => '描述',
  81. 'image' => '图片',
  82. 'status' => '处理状态',
  83. 'reason' => '退换货理由',
  84. 'remarks' => '店家备注',
  85. 'take_shipping_sn' => '用户发货物流单号',
  86. 'refund_mode' => '退款方式',
  87. ];
  88. }
  89. }