Merge branch 'master' into 'master_xieqiyu_78690'

# Conflicts:
#   module/productplan/model.php
This commit is contained in:
孙广明
2022-12-09 08:58:14 +00:00
30 changed files with 123 additions and 39 deletions
+6 -1
View File
@@ -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');