Update Model.php

This commit is contained in:
邹景立 2025-02-21 12:38:05 +08:00
parent 287951f7e3
commit 19abfdaaf8

View File

@ -19,7 +19,6 @@ declare (strict_types=1);
namespace think\admin; namespace think\admin;
use think\admin\helper\QueryHelper; use think\admin\helper\QueryHelper;
use think\db\Express;
/** /**
* 基础模型类 * 基础模型类
@ -116,30 +115,4 @@ abstract class Model extends \think\Model
return parent::__callStatic($method, $args); return parent::__callStatic($method, $args);
}); });
} }
/**
* 字段值增长
* @param string $field 字段名
* @param float $step 增长值
* @param int $lazyTime 延迟时间(秒)
* @return $this
*/
public function inc(string $field, float $step = 1, int $lazyTime = 0)
{
return $this->set($field, new Express('+', $step, $lazyTime));
}
/**
* 字段值减少.
*
* @param string $field 字段名
* @param float $step 增长值
* @param int $lazyTime 延迟时间(秒)
* @return $this
*/
public function dec(string $field, float $step = 1, int $lazyTime = 0)
{
return $this->set($field, new Express('-', $step, $lazyTime));
}
} }