StoreOrderStatus.php 838 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/12/28
  6. */
  7. namespace app\models\store;
  8. use crmeb\basic\BaseModel;
  9. use crmeb\traits\ModelTrait;
  10. /**
  11. * TODO 订单修改状态记录Model
  12. * Class StoreOrderStatus
  13. * @package app\models\store
  14. */
  15. class StoreOrderStatus extends BaseModel
  16. {
  17. /**
  18. * 模型名称
  19. * @var string
  20. */
  21. protected $name = 'store_order_status';
  22. use ModelTrait;
  23. public static function status($oid,$change_type,$change_message,$change_time = null)
  24. {
  25. if($change_time == null) $change_time = time();
  26. return self::create(compact('oid','change_type','change_message','change_time'));
  27. }
  28. public static function getTime($oid,$change_type)
  29. {
  30. return self::where('oid',$oid)->where('change_type',$change_type)->value('change_time');
  31. }
  32. }