UserBalanceOrder.php 674 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class UserBalanceOrder extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'userid' => 'int',
  10. 'ordersn' => 'string',
  11. 'paymoney' => 'float',
  12. 'status' => 'int',
  13. 'paytype' => 'int',
  14. 'payremark' => 'string',
  15. 'remark' => 'string',
  16. 'createtime' => 'int'
  17. ];
  18. // 设置json类型字段
  19. protected $json = ['payremark'];
  20. // 设置字段自动转换类型
  21. protected $type = [
  22. 'createtime' => 'timestamp:Y-m-d H:i:s'
  23. ];
  24. // 关联User
  25. public function user()
  26. {
  27. return $this->hasOne(User::class, "id", "userid");
  28. }
  29. }