Order.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace addons\cms\model;
  3. use think\Model;
  4. /**
  5. * 订单模型
  6. */
  7. class Order extends Model
  8. {
  9. protected $name = "cms_order";
  10. // 开启自动写入时间戳字段
  11. protected $autoWriteTimestamp = 'int';
  12. // 定义时间戳字段名
  13. protected $createTime = 'createtime';
  14. protected $updateTime = 'updatetime';
  15. // 追加属性
  16. protected $append = [];
  17. protected static $config = [];
  18. protected static function init()
  19. {
  20. $config = get_addon_config('cms');
  21. self::$config = $config;
  22. }
  23. /**
  24. * 检测订单
  25. * @deprecated
  26. */
  27. public static function checkOrder($id)
  28. {
  29. return \addons\cms\library\Order::check($id);
  30. }
  31. /**
  32. * 提交订单
  33. * @deprecated
  34. */
  35. public static function submitOrder($id, $paytype = 'wechat', $openid = '', $method = 'web')
  36. {
  37. return \addons\cms\library\Order::submit($id, $paytype, $method, $openid);
  38. }
  39. public function archives()
  40. {
  41. return $this->belongsTo('Archives', 'archives_id', 'id');
  42. }
  43. }