Voucher.php 669 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\api\model;
  3. class Voucher extends BaseModel
  4. {
  5. // 表名
  6. protected $name = 'voucher';
  7. // 自动写入时间戳字段
  8. protected $autoWriteTimestamp = 'integer';
  9. // 定义时间戳字段名
  10. protected $createTime = 'createtime';
  11. protected $updateTime = 'updatetime';
  12. protected $deleteTime = false;
  13. // 追加属性
  14. protected $append = [
  15. ];
  16. public static function getTakeEffectTime($enum)
  17. {
  18. $now_time = time();
  19. if ($enum === "today")
  20. return $now_time;
  21. if ("morrow" === $enum)
  22. return $now_time + (24 * 60 * 60);
  23. return $now_time;
  24. }
  25. }