* product: replace ?? with ?:.

This commit is contained in:
chentao
2023-05-12 14:46:47 +08:00
parent 78a39f9566
commit 88e093ccbd
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -121,9 +121,10 @@ class product extends control
$browseType = strtolower($browseType);
/* Pre process. */
$isProjectStory = $this->app->rawModule == 'projectstory';
$this->loadModel('datatable');
$this->loadModel('execution');
$isProjectStory = $this->app->rawModule == 'projectstory';
$cookieOrderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc';
/* Generate data. */
$showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : '';
@@ -131,7 +132,7 @@ class product extends control
$product = $this->productZen->getBrowseProduct($productID);
$project = $this->loadModel('project')->getByID($projectID);
list($branch, $branchID) = $this->productZen->getBranchAndBranchID($product, $branch);
$orderBy = $orderBy ?? ($this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc');
$orderBy = $orderBy ? $orderBy : $cookieOrderBy;
/* ATTENTION: be careful to change the order of follow sentencies. */
$this->productZen->setMenu4Browse($projectID, $productID, $branch, $storyType);
+1 -1
View File
@@ -1014,7 +1014,7 @@ class productZen extends product
/* If product does not exist in $this->products list, then attach it to the list. */
if($product && !isset($this->products[$product->id])) $this->products[$product->id] = $product->name;
return $product ?? false;
return $product ? $product : false;
}
/**