SplitbillLog.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace addons\YunfastPay\common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%addons_yunfast_pay_splitbill_log}}".
  6. *
  7. * @property int $id
  8. * @property int $mall_id 商城ID
  9. * @property int $payment_id 支付订单ID
  10. * @property string $order_no 订单号
  11. * @property string|null $req_data 请求数据
  12. * @property string|null $res_data 返回数据
  13. * @property int $status 状态
  14. * @property int $updated_at
  15. * @property int $created_at
  16. */
  17. class SplitbillLog extends ActiveRecord
  18. {
  19. protected static $json_fields = [
  20. 'req_data', 'res_data'
  21. ];
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%addons_yunfast_pay_splitbill_log}}';
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['mall_id', 'payment_id', 'order_no'], 'required'],
  36. [['mall_id', 'payment_id', 'status', 'updated_at', 'created_at'], 'integer'],
  37. [['req_data', 'res_data'], 'string'],
  38. [['order_no'], 'string', 'max' => 32],
  39. ];
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'id' => 'ID',
  48. 'mall_id' => 'Mall ID',
  49. 'payment_id' => 'Payment ID',
  50. 'order_no' => 'Order No',
  51. 'req_data' => 'Req Data',
  52. 'res_data' => 'Res Data',
  53. 'status' => 'Status',
  54. 'updated_at' => 'Updated At',
  55. 'created_at' => 'Created At',
  56. ];
  57. }
  58. /**
  59. * @return ActiveQueryInterface the relational query object.
  60. */
  61. public function getItem()
  62. {
  63. return $this->hasMany(SplitbillItem::class, ['log_id' => 'id']);
  64. }
  65. }