mirror of
https://github.com/Oreolek/kangana.git
synced 2024-05-18 17:08:19 +03:00
DAR-20: a case of missing letters
This commit is contained in:
parent
96fd45348a
commit
9c62f4facf
|
@ -89,7 +89,7 @@ class Model_Course extends ORM {
|
|||
**/
|
||||
public static function get_ids()
|
||||
{
|
||||
return DB::select('course_id')->from('clients_courses')->execute()->get('course_id');
|
||||
return DB::select('course_id')->distinct(TRUE)->from('clients_courses')->execute()->as_array(NULL, 'course_id');
|
||||
}
|
||||
|
||||
public static function get_period($course_id)
|
||||
|
|
|
@ -96,8 +96,26 @@ class Model_Task extends ORM {
|
|||
->as_array(NULL, 'letter_id');
|
||||
if (is_array($letters))
|
||||
{
|
||||
$diff = array_diff($letters, $sent_letters);
|
||||
return $diff[0];
|
||||
$retval = $letters[0];
|
||||
$i = 0;
|
||||
while ($i < $cnt)
|
||||
{
|
||||
$retval = $letters[$i];
|
||||
if (!in_array($retval, $sent_letters))
|
||||
{
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($i < $cnt)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
elseif( $i < count($letters))
|
||||
{
|
||||
return $letters[$i];
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue