StoreOrderStatus.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/11
  6. */
  7. namespace app\admin\model\order;
  8. use crmeb\traits\ModelTrait;
  9. use crmeb\basic\BaseModel;
  10. /**
  11. * 订单操作纪律model
  12. * Class StoreOrderStatus
  13. * @package app\admin\model\store
  14. */
  15. class StoreOrderStatus extends BaseModel
  16. {
  17. /**
  18. * 模型名称
  19. * @var string
  20. */
  21. protected $name = 'store_order_status';
  22. use ModelTrait;
  23. /**
  24. * @param $oid
  25. * @param $type
  26. * @param $message
  27. */
  28. public static function setStatus($oid, $type, $message)
  29. {
  30. $data['oid'] = (int)$oid;
  31. $data['change_type'] = $type;
  32. $data['change_message'] = $message;
  33. $data['change_time'] = time();
  34. self::create($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->where('change_type','LIKE','mer_%');
  56. $model = $model->order('change_time asc');
  57. return self::page($model);
  58. }
  59. }