Merge branch 'master' into 'master_xieqiyu_78690'
# Conflicts: # module/productplan/model.php
This commit is contained in:
@@ -460,11 +460,12 @@ class productplanModel extends model
|
||||
*
|
||||
* @param int $productID
|
||||
* @param array $branches
|
||||
* @param string $param
|
||||
* @param bool $skipParent
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBranchPlanPairs($productID, $branches = '', $skipParent = false)
|
||||
public function getBranchPlanPairs($productID, $branches = '', $param = '', $skipParent = false)
|
||||
{
|
||||
$branchQuery = '';
|
||||
if($branches !== '' and $branches !== 'all')
|
||||
@@ -479,10 +480,14 @@ class productplanModel extends model
|
||||
$branchQuery .= ')';
|
||||
}
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$param = strtolower($param);
|
||||
$plans = $this->dao->select('parent,branch,id,title,begin,end')->from(TABLE_PRODUCTPLAN)
|
||||
->where('product')->eq($productID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!empty($branchQuery))->andWhere($branchQuery)->fi()
|
||||
->beginIF($branches != '')->andWhere('branch')->in($branches)->fi()
|
||||
->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi()
|
||||
->orderBy('begin desc')
|
||||
->fetchAll('id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user