| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\api\model;
- class Voucher extends BaseModel
- {
- // 表名
- protected $name = 'voucher';
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'integer';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected $deleteTime = false;
- // 追加属性
- protected $append = [
- ];
- public static function getTakeEffectTime($enum)
- {
- $now_time = time();
- if ($enum === "today")
- return $now_time;
- if ("morrow" === $enum)
- return $now_time + (24 * 60 * 60);
- return $now_time;
- }
- }
|