QiDingDongOrder.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace addons\QiDingDong\common\models;
  3. use common\models\mall\Mall;
  4. use common\models\order\Order;
  5. use Yii;
  6. /**
  7. * This is the model class for table "qimall_addons_qi_ding_dong_order".
  8. *
  9. * @property int $id ID
  10. * @property int $mall_id 商城ID
  11. * @property int $created_at 创建时间
  12. * @property int $updated_at 更新时间
  13. * @property int $status 状态
  14. * @property int $order_id 订单ID
  15. * @property int $user_id 订单ID
  16. * @property string $order_no 订单编号
  17. * @property string|null $last_resp 订单编号
  18. * @property string $third_order_no 第三方订单编号
  19. * @property array|null $content 最后一次更新数据
  20. * @property array|null $post 最后一次更新数据
  21. * @property array|null $order_detail_ids 最后一次更新数据
  22. * @property int $req_success 订单详情ID
  23. * @property string $last_req 订单编号
  24. */
  25. class QiDingDongOrder extends \common\models\base\BaseActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return 'qimall_addons_qi_ding_dong_order';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['mall_id', 'created_at', 'updated_at', 'status', 'order_id', 'user_id', 'req_success'], 'integer'],
  41. [['content', 'post', 'order_detail_ids'], 'safe'],
  42. [['order_no'], 'string', 'max' => 30],
  43. [['third_order_no'], 'string', 'max' => 50],
  44. [['last_req'], 'string', 'max' => 255],
  45. [['last_resp'], 'string']
  46. ];
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function attributeLabels()
  52. {
  53. return [
  54. 'id' => 'ID',
  55. 'mall_id' => 'Mall ID',
  56. 'created_at' => 'Created At',
  57. 'updated_at' => 'Updated At',
  58. 'status' => 'Status',
  59. 'order_id' => 'Order ID',
  60. 'order_no' => 'Order No',
  61. 'third_order_no' => 'Third Order No',
  62. 'content' => 'Content',
  63. ];
  64. }
  65. public function getOrder()
  66. {
  67. return $this->hasOne(Order::class, ['id' => 'order_id']);
  68. }
  69. public function getMall()
  70. {
  71. return $this->hasOne(Mall::class, ['id' => 'mall_id']);
  72. }
  73. }