File tree Expand file tree Collapse file tree
src/Model/Repository/Mysql Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,13 +19,17 @@ public function __construct(\PDO $db)
1919
2020 public function getNextTasks ()
2121 {
22- $ query = 'SELECT * FROM ' . Consts::RECURRING_TASKS_TABLE_NAME . ' WHERE status = :status_recu
23- AND recu_id NOT IN (SELECT DISTINCT tasks.recu_id FROM tasks WHERE status = :status) ' ;
22+ $ query = sprintf (
23+ 'SELECT * FROM %s
24+ WHERE status=%d
25+ AND recu_id NOT IN (SELECT DISTINCT recu_id FROM %s WHERE status=%d AND recu_id > 0) ' ,
26+ Consts::RECURRING_TASKS_TABLE_NAME ,
27+ Consts::RECURRING_TASK_STATUS_ACTIVE ,
28+ Consts::TASKS_TABLE_NAME ,
29+ Consts::STATUS_PENDING
30+ );
2431
25- $ stmt = $ this ->pdo ->prepare ($ query );
26- $ stmt ->bindValue (':status_recu ' , \G4 \Tasker \Consts::RECURRING_TASK_STATUS_ACTIVE , \PDO ::PARAM_INT );
27- $ stmt ->bindValue (':status ' , \G4 \Tasker \Consts::STATUS_PENDING , \PDO ::PARAM_INT );
28- $ stmt ->execute ();
32+ $ stmt = $ this ->pdo ->query ($ query );
2933
3034 return array_map (function ($ data ) {
3135 return \G4 \Tasker \Model \Domain \Recurring::fromData ($ data );
You can’t perform that action at this time.
0 commit comments