StoreOrderStatus.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\merchant\model\order;
  12. use traits\ModelTrait;
  13. use basic\ModelBasic;
  14. /**
  15. * 订单操作纪律model
  16. * Class StoreOrderStatus
  17. * @package app\admin\model\order
  18. */
  19. class StoreOrderStatus extends ModelBasic
  20. {
  21. use ModelTrait;
  22. /**
  23. * @param $oid
  24. * @param $type
  25. * @param $message
  26. */
  27. public static function setStatus($oid, $type, $message, $order_type = 0)
  28. {
  29. $data['oid'] = (int)$oid;
  30. $data['type'] = $order_type;
  31. $data['change_type'] = $type;
  32. $data['change_message'] = $message;
  33. $data['change_time'] = time();
  34. self::set($data);
  35. }
  36. /**
  37. * @param $where
  38. * @return array
  39. */
  40. public static function systemPage($oid)
  41. {
  42. $model = new self;
  43. $model = $model->where('oid', $oid);
  44. $model = $model->order('change_time asc');
  45. return self::page($model);
  46. }
  47. /**
  48. * @param $where
  49. * @return array
  50. */
  51. public static function systemPageMer($oid)
  52. {
  53. $model = new self;
  54. $model = $model->where('oid', $oid);
  55. $model = $model->order('change_time asc');
  56. return self::page($model);
  57. }
  58. }