* Finisha task.

This commit is contained in:
zhouxudong
2022-08-09 05:49:27 +00:00
parent ef847f1169
commit 3cc9977663
3 changed files with 8 additions and 12 deletions
+5 -9
View File
@@ -705,7 +705,7 @@ class program extends control
}
/**
* ajax get childish information.
* Ajax: Get childish information.
*
* @param int $programID
* @access public
@@ -713,15 +713,11 @@ class program extends control
*/
public function ajaxGetChildInfo($programID)
{
$children = $this->program->getChildren($programID);
$data = array();
$minChildBegin = $this->dao->select('begin as minBegin')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->orderBy('begin_asc')->fetch('minBegin');
$maxChildEnd = $this->dao->select('end as maxEnd')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->ne('0000-00-00')->orderBy('end_desc')->fetch('maxEnd');
if($children > 0)
{
$minChildBegin = $this->dao->select('begin as minBegin')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->orderBy('begin_asc')->fetch();
$maxChildEnd = $this->dao->select('end as maxEnd')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->ne('0000-00-00')->orderBy('end_desc')->fetch();
}
$data = array('minChildBegin' => $minChildBegin->minBegin, 'maxChildEnd' => $maxChildEnd->maxEnd);
$data = array('minChildBegin' => $minChildBegin, 'maxChildEnd' => $maxChildEnd);
echo json_encode($data);
}