HuifuPayOrderModel.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace addons\HuifuPay\common\models;
  3. use Yii;
  4. use yii\db\ActiveRecord;
  5. use common\models\common\PaymentTrade;
  6. /**
  7. * This is the model class for table "{{%addons_huifupay_pay_order}}".
  8. *
  9. * @property int $id
  10. * @property int $mall_id 商城id
  11. * @property int $payment_id payment id
  12. * @property string $hf_order_no 汇付支付流水号
  13. * @property string $trade_no 支付流水单号
  14. * @property string $trade_type 支付流水单号
  15. * @property int|null $updated_at
  16. * @property int|null $created_at
  17. * @property array|null $notify
  18. */
  19. class HuifuPayOrderModel extends \common\models\base\BaseActiveRecord
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public static function tableName()
  25. {
  26. return '{{%addons_huifupay_pay_order}}';
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function rules()
  32. {
  33. return [
  34. [['mall_id', 'trade_no','hf_order_no'], 'required'],
  35. [['mall_id','updated_at', 'created_at'], 'integer'],
  36. [['hf_order_no', 'trade_no', 'trade_type'], 'string', 'max' => 64],
  37. [['notify'], 'safe']
  38. ];
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'mall_id' => 'Mall ID',
  48. 'hf_order_no' => 'order No',
  49. 'trade_no' => 'Trade No',
  50. 'updated_at' => 'Updated At',
  51. 'created_at' => 'Created At'
  52. ];
  53. }
  54. public function getTrade()
  55. {
  56. return $this->hasOne(PaymentTrade::class, ['out_trade_no' => 'trade_no']);
  57. }
  58. }