* Finish task#8546

This commit is contained in:
leiyong
2020-12-01 11:17:57 +08:00
parent 43804684d7
commit 53e0784d6a
4 changed files with 25 additions and 3 deletions
+1
View File
@@ -911,6 +911,7 @@ class block extends control
->beginIF($storyType)->andWhere('type')->eq($storyType)->fi()
->groupBy('product, stage')
->fetchGroup('product', 'stage');
/* Padding the stories to sure all status have records. */
foreach($stories as $product => $story)
{
@@ -124,7 +124,7 @@ $(function()
<div class="table-row">
<div class="col-6 text-middle">
<div class="tile">
<div class="tile-title"><?php echo $lang->story->total;?></div>
<div class="tile-title"><?php echo $product->conceptName;?></div>
<?php if($product->stories):?>
<div class="tile-amount"><?php echo array_sum($product->stories);?></div>
<?php common::printLink('product', 'browse', "productID={$product->id}&branch=&type=allstory", $lang->story->viewAll . '<span class="label label-badge label-icon"><i class="icon icon-arrow-right"></i></span>', '', 'class="btn btn-primary btn-circle btn-icon-right btn-sm"');?>
+2 -2
View File
@@ -60,8 +60,8 @@ class product extends control
if(common::hasPriv('product', 'create')) $this->lang->TRActions = html::a($this->createLink('product', 'create'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->product->create, '', "class='btn btn-primary'");
$this->view->title = $this->lang->product->index;
$this->view->position[] = $this->lang->product->index;
$this->view->title = $this->lang->product->index;
$this->view->position[] = $this->lang->product->index;
$this->display();
}
+21
View File
@@ -425,6 +425,8 @@ class productModel extends model
{
$closedProducts[$product->id] = $product;
}
$concept = $this->getStoryConceptByProduct($product->id);
$product->conceptName = $concept->SR;
}
$products = $mineProducts + $otherProducts + $closedProducts;
@@ -432,6 +434,25 @@ class productModel extends model
return array_slice($products, 0, $num, true);
}
/*
* Get the concept of requirements for product use.
*
* @param int $productID
* @access public
* @return void
*/
public function getStoryConceptByProduct($productID = 0)
{
$product = $this->getById($productID);
$URList = $this->dao->select('`key`,`value`')->from(TABLE_LANG)->where('module')->eq('custom')->andWhere('section')->eq('URList')->andWhere('lang')->eq($this->app->clientLang)->fetchPairs();
$SRList = $this->dao->select('`key`,`value`')->from(TABLE_LANG)->where('module')->eq('custom')->andWhere('section')->eq('SRList')->andWhere('lang')->eq($this->app->clientLang)->fetchPairs();
$concept = new stdClass();
$concept->UR = zget($URList, $product->storyConcept, $this->config->URCommonList[$this->app->clientLang]);
$concept->SR = zget($SRList, $product->storyConcept, $this->config->SRCommonList[$this->app->clientLang]);
return $concept;
}
/*
* Get product switcher.
*