def next_create_subtask_step(message):
name_task = message.text
sqlb = "SELECT id FROM tasks WHERE id = 6"
print(sqlb)
db.execute(sqlb)
task_id = db.fetchone()
print(task_id)
task = task_id[0]
data_subtask['id_task'] = task
msg = bot.reply_to(message, 'Придумайте название подзадачи')
bot.register_next_step_handler(msg, request_subtask)
sqlb = "SELECT id FROM tasks WHERE name = '{}'".format(name_task)
db.execute(sqlb)
task_id = db.fetchone()
task = task_id[0]
/**
* Save an array of new models and attach them to the parent model.
*
* @param \Illuminate\Support\Collection|array $models
* @param array $pivotAttributes
* @return array
*/
public function saveMany($models, array $pivotAttributes = [])
{
foreach ($models as $key => $model) {
$this->save($model, (array) ($pivotAttributes[$key] ?? []), false);
}
$this->touchIfTouching();
return $models;
}