HuifuBillShare.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. namespace addons\HuifuPay\common\models;
  3. use common\models\order\Order;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_huifupay_bill_share".
  7. *
  8. * @property int $id
  9. * @property int $mall_id
  10. * @property string $merchant_no 分账方账号
  11. * @property int $trade_id 支付流水ID
  12. * @property int $status 100:成功,101:失败,102:已创建
  13. * @property int|null $updated_at
  14. * @property int|null $created_at
  15. * @property array|null $response
  16. * @property string $order_no 订单号
  17. * @property float $share_amount 商家分账金额
  18. * @property float $fee 平台手续费
  19. * @property float $finally_fee 平台手续费
  20. * @property float $finally_share_amount 平台手续费
  21. * @property float $fee_rate 平台手续费
  22. * @property float $refund_amount 平台手续费
  23. * @property float $order_amount 平台手续费
  24. * @property float $pay_fee 平台手续费
  25. * @property int $store_id 门店ID
  26. * @property int $settle_status 门店ID
  27. * @property int $settle_at 门店ID
  28. * @property int $settle_type 门店ID
  29. * @property string $trx_no 汇聚分账支付订单号
  30. * @property string $trade_no 汇聚分账支付订单号
  31. */
  32. class HuifuBillShare extends \common\models\base\BaseActiveRecord
  33. {
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public static function tableName()
  38. {
  39. return 'qimall_addons_huifupay_bill_share';
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function rules()
  45. {
  46. return [
  47. [['mall_id', 'trade_id', 'status', 'updated_at', 'created_at', 'store_id', 'settle_status', 'settle_at', 'settle_type'], 'integer'],
  48. [['share_amount', 'fee', 'fee_rate', 'refund_amount', 'order_amount', 'finally_fee', 'finally_share_amount', 'pay_fee'], 'number'],
  49. [['merchant_no', 'trx_no', 'trade_no'], 'string', 'max' => 32],
  50. [['order_no'], 'string', 'max' => 50],
  51. [['response'], 'safe'],
  52. ];
  53. }
  54. /**
  55. * {@inheritdoc}
  56. */
  57. public function attributeLabels()
  58. {
  59. return [
  60. 'id' => 'ID',
  61. 'mall_id' => 'Mall ID',
  62. 'merchant_no' => 'Merchant No',
  63. 'trade_id' => 'Trade ID',
  64. 'status' => 'Status',
  65. 'updated_at' => 'Updated At',
  66. 'created_at' => 'Created At',
  67. 'order_no' => 'Order No',
  68. 'share_amount' => 'Share Amount',
  69. 'fee' => 'Fee',
  70. 'store_id' => 'Store ID',
  71. 'trx_no' => 'Trx No',
  72. ];
  73. }
  74. public function getOrder()
  75. {
  76. return $this->hasOne(Order::class, ['order_no' => 'order_no']);
  77. }
  78. }