OrderUnion.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. /**
  10. * This is the model class for table "{{%order_union}}".
  11. *
  12. * @property integer $id
  13. * @property integer $store_id
  14. * @property integer $user_id
  15. * @property string $order_no
  16. * @property string $order_id_list
  17. * @property string $price
  18. * @property integer $is_pay
  19. * @property integer $created_at
  20. * @property integer $is_delete
  21. */
  22. class OrderUnion extends \yii\db\ActiveRecord
  23. {
  24. /**
  25. * @inheritdoc
  26. */
  27. public static function tableName()
  28. {
  29. return '{{%order_union}}';
  30. }
  31. /**
  32. * @inheritdoc
  33. */
  34. public function rules()
  35. {
  36. return [
  37. [['store_id', 'user_id', 'order_no', 'order_id_list', 'price'], 'required'],
  38. [['store_id', 'user_id', 'is_pay', 'created_at', 'is_delete'], 'integer'],
  39. [['order_id_list'], 'string'],
  40. [['price'], 'number'],
  41. [['order_no', 'type'], 'string', 'max' => 255],
  42. ];
  43. }
  44. /**
  45. * @inheritdoc
  46. */
  47. public function attributeLabels()
  48. {
  49. return [
  50. 'id' => 'ID',
  51. 'store_id' => 'Store ID',
  52. 'user_id' => 'User ID',
  53. 'order_no' => '支付单号',
  54. 'order_id_list' => '订单id列表',
  55. 'price' => '支付金额',
  56. 'is_pay' => '是否已付款0=未付款,1=已付款',
  57. 'created_at' => 'Addtime',
  58. 'is_delete' => 'Is Delete',
  59. 'type' => '订单类型',
  60. ];
  61. }
  62. public function getUser()
  63. {
  64. return $this->hasOne(User::className(),['id'=>'user_id']);
  65. }
  66. }