This commit is contained in:
lanzongjun
2022-11-29 14:35:07 +08:00
parent 6356683483
commit 9077e9b4a3
6 changed files with 49 additions and 17 deletions
+8 -6
View File
@@ -4625,13 +4625,15 @@ class executionModel extends model
{
foreach($branches as $branchID => $branchName) $branchIdList[$branchID] = $branchID;
}
$plans = $this->dao->select('id,title,product,parent,begin,end')->from(TABLE_PRODUCTPLAN)
$query = $this->dao->select('id,title,product,parent,begin,end')->from(TABLE_PRODUCTPLAN)
->where('product')->in(array_keys($products))
->andWhere('deleted')->eq(0)
->andWhere('branch')->in($branchIdList)->fi()
->orderBy('begin desc')
->fetchAll('id');
->andWhere('deleted')->eq(0)->andWhere("FIND_IN_SET('', branch)", true);
foreach($branchIdList as $branchID)
{
$query->orWhere("FIND_IN_SET('$branchID', branch)");
}
$query->markRight(1)->orderBy('begin desc');
$plans = $query->fetchAll('id');
$plans = $this->productplan->reorder4Children($plans);
$productPlans = array();