* fix task model empty

This commit is contained in:
滔哥
2017-10-23 13:19:06 +08:00
parent b19c1ce1eb
commit a8c27a1513
8 changed files with 56 additions and 4 deletions
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午10:33
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午10:33
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午11:51
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午10:57
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午11:51
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午10:32
*/
+7
View File
@@ -0,0 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: lvtao
* Date: 2017/10/23
* Time: 上午10:44
*/
+7 -4
View File
@@ -1081,10 +1081,13 @@ class taskModel extends model
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', ($productID or $type == 'needconfirm') ? false : true);
$taskList = array_keys($tasks);
$children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->in($taskList)->orderBy('id_desc')->fetchGroup('parent');
if(!empty($children)) foreach($children as $key => $child) $tasks[$key]->children = $child;
$teams = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task');
if($teams) foreach($teams as $key => $team) if(!empty($team)) $tasks[$key]->team = $team;
if(!empty($taskList))
{
$children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->in($taskList)->orderBy('id_desc')->fetchGroup('parent');
if(!empty($children)) foreach($children as $key => $child) $tasks[$key]->children = $child;
$teams = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task');
if($teams) foreach($teams as $key => $team) if(!empty($team)) $tasks[$key]->team = $team;
}
if($tasks) return $this->processTasks($tasks);
return array();