Proyectos de Subversion LeadersLinked - Services

Rev

Rev 359 | Rev 364 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 359 Rev 363
Línea 17... Línea 17...
17
 
17
 
18
 
18
 
19
class HabitReportMapper extends MapperCommon
19
class HabitReportMapper extends MapperCommon
20
{
20
{
21
    const _TABLE_A = 'tbl_habits_skills';
-
 
Línea 22... Línea 21...
22
    const _TABLE_B = 'tbl_habits_user_logs_categories';
21
    const _TABLE_A = 'tbl_habits_skills';
23
    const _TABLE_C = 'tbl_habits_user_logs_content';
22
    const _TABLE_B = 'tbl_habits_skills_registers';
24
 
23
 
Línea 54... Línea 53...
54
    /**
53
    /**
55
     * 
54
     * 
56
     * @param int $id
55
     * @param int $id
57
     * @return array
56
     * @return array
58
     */
57
     */
59
    public function fetchFiveteen($id)
58
    public function fetchDaysIntervalsRegisterList($id, $dateInitial, $dateFinal)
60
    {
59
    {
61
        // Crear el objeto de selección
60
        // Crear el objeto de selección
62
        $select = $this->sql->select(self::_TABLE_C);
61
        $select = $this->sql->select(self::_TABLE_B);
-
 
62
 
-
 
63
        // Agregar las condiciones de filtrado
-
 
64
        $select->where
63
        $select->where->equalTo('user_id', $id);
65
            ->equalTo('user_id', $id)
-
 
66
            ->greaterThanOrEqualTo('added_on', $dateInitial)
-
 
67
            ->lessThanOrEqualTo('added_on', $dateFinal);
-
 
68
 
-
 
69
        // Ordenar por fecha de forma descendente
64
        $select->order('added_on DESC');
70
        $select->order('added_on DESC');
65
        $select->limit(15);
-
 
Línea 66... Línea 71...
66
 
71
 
67
        // Ejecutar la consulta
72
        // Ejecutar la consulta
68
        $statement = $this->sql->prepareStatementForSqlObject($select);
73
        $statement = $this->sql->prepareStatementForSqlObject($select);