推拉函数与queue
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user