Order.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace addons\WechatMini\common\models\video\order;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%addon_wechat_capabilities_order}}".
  6. *
  7. * @property int $out_order_id
  8. * @property string $openid
  9. * @property int $scene 品牌ID
  10. * @property string $ticket 拉起收银台的ticket
  11. * @property int $ticket_expire_time ticket有效截止时间
  12. * @property int $status 状态
  13. * @property int $created_at 创建时间
  14. * @property int $updated_at 修改时间
  15. */
  16. class Order extends \common\models\base\BaseModel
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public static function tableName()
  22. {
  23. return '{{%addon_wechat_mini_video_order}}';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['out_order_id'], 'required'],
  32. [['out_order_id', 'delivery_type', 'finish_all_delivery', 'scene', 'ticket_expire_time', 'status', 'created_at', 'updated_at'], 'integer'],
  33. [['openid'], 'string', 'max' => 50],
  34. [['ticket'], 'string', 'max' => 255],
  35. [['out_order_id'], 'unique'],
  36. ];
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function attributeLabels()
  42. {
  43. return [
  44. 'out_order_id' => '关联订单ID',
  45. 'openid' => 'Openid',
  46. 'scene' => '场景指',
  47. 'delivery_type' => '配送类型',
  48. 'finish_all_delivery' => '发货完成状态',
  49. 'ticket' => '拉起收银台的ticket',
  50. 'ticket_expire_time' => 'ticket有效截止时间',
  51. 'final_price' => '订单总金额',
  52. 'status' => '状态',
  53. 'created_at' => '创建时间',
  54. 'updated_at' => '修改时间',
  55. ];
  56. }
  57. /**
  58. * @return \yii\db\ActiveQuery
  59. */
  60. public function getOrder()
  61. {
  62. return $this->hasOne(\addons\TinyShop\common\models\order\Order::class, ['id' => 'out_order_id']);
  63. }
  64. }
粤ICP备19079148号