* Optimize convert2Pinyin, and cache executions for bug browse.

This commit is contained in:
Lufei
2023-06-06 16:28:39 +08:00
parent 1ece1244bc
commit 0648689d24
2 changed files with 16 additions and 4 deletions
+11 -2
View File
@@ -164,8 +164,17 @@ class bug extends control
if($this->app->getViewType() == 'mhtml' || $this->app->getViewType() == 'xhtml') $recPerPage = 10;
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Get executios. */
$executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'empty|withdelete|hideMultiple');
/* Get executions. */
$cacheKey = "bugBrowse{$this->projectID}";
if($this->config->cache->enable && $this->cache->has($cacheKey))
{
$executions = $this->cache->get($cacheKey);
}
else
{
$executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'empty|withdelete|hideMultiple');
if($this->config->cache->enable) $this->cache->set($cacheKey, $executions);
}
/* Get product id list. */
$productIDList = $productID ? $productID : array_keys($this->products);
+5 -2
View File
@@ -2869,11 +2869,14 @@ EOF;
$itemsPinYin = explode(trim($sign), $convertedPinYin);
foreach($notConvertedItems as $item)
{
$itemPinYin = array_shift($itemsPinYin);
$key = key($itemsPinYin);
$itemPinYin = $itemsPinYin[$key];
unset($itemsPinYin[$key]);
$wordsPinYin = explode("\t", trim($itemPinYin));
$abbr = '';
foreach($wordsPinYin as $i => $wordPinyin)
foreach($wordsPinYin as $wordPinyin)
{
if($wordPinyin)
{