ReOrderRefundMoney.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. use yii\behaviors\TimestampBehavior;
  10. /**
  11. * This is the model class for table "{{%re_order_refund_money}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $user_id
  16. * @property integer $order_id
  17. * @property string $order_refund_no
  18. * @property string $refund_price
  19. * @property string $desc
  20. * @property integer $status
  21. * @property string $status_desc
  22. * @property integer $created_at
  23. * @property integer $is_delete
  24. */
  25. class ReOrderRefundMoney extends \yii\db\ActiveRecord
  26. {
  27. const AUDIT_STATUS_AUDITING = 0;//审核中
  28. const AUDIT_STATUS_OK = 1;//已同意
  29. const AUDIT_STATUS_REJECT = 2;//拒绝
  30. /**
  31. * @inheritdoc
  32. */
  33. public static function tableName()
  34. {
  35. return '{{%re_order_refund_money}}';
  36. }
  37. public function behaviors()
  38. {
  39. return [
  40. [
  41. // 自动更新创建和更新时间
  42. 'class' => TimestampBehavior::class,
  43. 'value' => time()
  44. ]
  45. ];
  46. }
  47. /**
  48. * @inheritdoc
  49. */
  50. public function attributeLabels()
  51. {
  52. return [
  53. 'id' => 'ID',
  54. 'store_id' => 'Store ID',
  55. 'user_id' => 'User ID',
  56. 'order_id' => 'Order ID',
  57. 'order_refund_no' => '退款单号',
  58. 'refund_price' => '退款金额',
  59. 'sub_balance' => '扣减余额',
  60. 'sub_integral' => '扣减积分',
  61. 'desc_user' => '退款说明(用户)',
  62. 'desc_admin' => '退款说明(管理员)',
  63. 'status' => '退款状态:0失败,1成功',
  64. 'status_desc' => '退款失败原因',
  65. 'audit_status' => '申请状态,0审核中,1已同意,2已拒绝',
  66. 'created_at' => 'Addtime',
  67. 'is_delete' => 'Is Delete',
  68. ];
  69. }
  70. public function beforeSave($insert)
  71. {
  72. $this->desc_user = \yii\helpers\Html::encode($this->desc_user);
  73. $this->desc_admin = \yii\helpers\Html::encode($this->desc_admin);
  74. return parent::beforeSave($insert);
  75. }
  76. }