推拉函数与queue

This commit is contained in:
cano
2024-03-03 09:39:06 +08:00
parent f5f7168009
commit 66d88ea2b3
15 changed files with 476 additions and 108 deletions

View File

@ -27,6 +27,14 @@ class BaseModel extends Model
return $this->newQuery()->create($aItem);
}
function addItemWithCreateTime($aItem,$col = 'created_at'): Model|\Illuminate\Database\Eloquent\Builder|bool
{
$aItem = $this->checkColInFill($aItem);
if (empty($aItem)) return false;
$aItem[$col] = date('Y-m-d H:i:s');
return $this->newQuery()->create($aItem);
}
function delItem($id)
{
return $this->newQuery()->where($this->primaryKey, $id)->delete();