This commit is contained in:
tianshujie
2022-08-11 09:30:06 +08:00
parent ad2cab0eff
commit 6c0c3a3cda
2 changed files with 17 additions and 12 deletions
+3 -3
View File
@@ -164,19 +164,19 @@
<td colspan="3" id="plansBox">
<div class='row'>
<?php if(isset($plan) && !empty($plan->begin)):?>
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[{$plan->product}][{$plan->branch}]", $productPlan, $plan->id, "class='form-control chosen' multiple");?></div>
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[{$plan->product}][{$plan->branch}][]", $productPlan, $plan->id, "class='form-control chosen' multiple");?></div>
<?php js::set('currentPlanID', $plan->id)?>
<?php elseif($copyExecutionID):?>
<?php $i = 0;?>
<?php foreach($products as $product):?>
<?php foreach($linkedBranches[$product->id] as $branchID => $branch):?>
<?php $plans = isset($productPlans[$product->id][$branchID]) ? $productPlans[$product->id][$branchID] : array();?>
<div class="col-sm-4" id="plan<?php echo $i;?>"><?php echo html::select("plans[{$product->id}][$branchID]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen' multiple");?></div>
<div class="col-sm-4" id="plan<?php echo $i;?>"><?php echo html::select("plans[{$product->id}][$branchID][]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen' multiple");?></div>
<?php $i++;?>
<?php endforeach;?>
<?php endforeach;?>
<?php else:?>
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[][]", $productPlan, '', "class='form-control chosen' multiple");?></div>
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[][][]", $productPlan, '', "class='form-control chosen' multiple");?></div>
<?php js::set('currentPlanID', '')?>
<?php endif;?>
</div>
+14 -9
View File
@@ -116,16 +116,21 @@ class productplanModel extends model
if(!empty($plans))
{
$plans = $this->reorder4Children($plans);
$planIdList = array_keys($plans);
$plans = $this->reorder4Children($plans);
$planIdList = array_keys($plans);
$planProjects = array();
$planProjects = $this->dao->select('t1.*,t2.type')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($product)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.plan')->in(array_keys($plans))
->andWhere('t2.type')->in('sprint,stage,kanban')
->fetchPairs('plan', 'project');
foreach($planIdList as $planID)
{
$planProjects[$planID] = $this->dao->select('t1.*,t2.type')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($product)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.plan')->like(",$planID,")
->andWhere('t2.type')->in('sprint,stage,kanban')
->orderBy('project_desc')
->fetch('project');
}
$storyCountInTable = $this->dao->select('plan,count(story) as count')->from(TABLE_PLANSTORY)->where('plan')->in($planIdList)->groupBy('plan')->fetchPairs('plan', 'count');
$product = $this->loadModel('product')->getById($product);