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.

88 lines
2.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_payment_log".
  7. *
  8. * @property int $id
  9. * @property int $order_id 订单id
  10. * @property string $wx_refund_id 微信退款单号
  11. * @property string $mch_id 商户号
  12. * @property int $order_amount 订单金额
  13. * @property int $payment_amount 支付金额
  14. * @property string $notify_url 支付回调路径
  15. * @property int $type 类型
  16. * @property int $status 状态
  17. * @property string $refund_account 退款账户
  18. * @property int $updated_at 更新时间
  19. * @property int $created_at 创建时间
  20. */
  21. class PaymentLog extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public static function tableName()
  27. {
  28. return 'ats_payment_log';
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['order_id', 'order_amount', 'payment_amount', 'type', 'status'], 'integer'],
  37. [['wx_refund_id', 'mch_id', 'refund_account'], 'string', 'max' => 64],
  38. [['notify_url'], 'string', 'max' => 255],
  39. ];
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'id' => 'id',
  48. 'order_id' => '订单id',
  49. 'wx_refund_id' => '微信退款单号',
  50. 'mch_id' => '商户号',
  51. 'order_amount' => '订单金额',
  52. 'payment_amount' => '支付金额',
  53. 'notify_url' => '支付回调路径',
  54. 'type' => '类型',
  55. 'status' => '状态',
  56. 'refund_account' => '退款账户',
  57. 'updated_at' => '更新时间',
  58. 'created_at' => '创建时间',
  59. ];
  60. }
  61. /**
  62. * @author linyao
  63. * @email 602604991@qq.com
  64. * @created Nov 8, 2019
  65. *
  66. * 行为存储创建时间和更新时间
  67. */
  68. public function behaviors()
  69. {
  70. return [
  71. [
  72. 'class' => TimestampBehavior::className(),
  73. 'createdAtAttribute' => 'created_at',
  74. 'updatedAtAttribute' => 'updated_at',
  75. 'value' => function() {
  76. return time();
  77. },
  78. ],
  79. ];
  80. }
  81. }