QiShangTongOrder.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. namespace addons\QiShangTong\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_shang_tong_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 $order_status 订单ID
  16. * @property int $is_logistics 订单ID
  17. * @property int $user_id 订单ID
  18. * @property string $order_no 订单编号
  19. * @property string|null $last_resp 订单编号
  20. * @property string $third_order_no 第三方订单编号
  21. * @property array|null $content 最后一次更新数据
  22. * @property array|null $post 请求数据
  23. * @property array|null $order_detail_ids 订单详情ID
  24. * @property int $req_success 订单详情ID
  25. * @property string $last_req 订单编号
  26. */
  27. class QiShangTongOrder extends \common\models\base\BaseActiveRecord
  28. {
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public static function tableName()
  33. {
  34. return 'qimall_addons_qi_shang_tong_order';
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function rules()
  40. {
  41. return [
  42. [['mall_id', 'created_at', 'updated_at', 'status', 'order_id', 'order_status', 'is_logistics', 'user_id', 'req_success'], 'integer'],
  43. [['content', 'post', 'order_detail_ids'], 'safe'],
  44. [['order_no'], 'string', 'max' => 30],
  45. [['third_order_no'], 'string', 'max' => 50],
  46. [['last_req'], 'string', 'max' => 255],
  47. [['last_resp'], 'string']
  48. ];
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public function attributeLabels()
  54. {
  55. return [
  56. 'id' => 'ID',
  57. 'mall_id' => 'Mall ID',
  58. 'created_at' => 'Created At',
  59. 'updated_at' => 'Updated At',
  60. 'status' => 'Status',
  61. 'order_id' => 'Order ID',
  62. 'order_no' => 'Order No',
  63. 'third_order_no' => 'Third Order No',
  64. 'content' => 'Content',
  65. 'post' => 'Post',
  66. 'order_detail_ids' => 'Order Detail Ids',
  67. ];
  68. }
  69. public function getOrder()
  70. {
  71. return $this->hasOne(Order::class, ['id' => 'order_id']);
  72. }
  73. public function getMall()
  74. {
  75. return $this->hasOne(Mall::class, ['id' => 'mall_id']);
  76. }
  77. }