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.

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