Merge branch 'cyy_fixbug' into 18.4

This commit is contained in:
caoyanyi
2023-04-25 08:45:37 +08:00
5 changed files with 6 additions and 5 deletions
@@ -25,7 +25,7 @@ public function getPairs($mode = '', $programID = 0, $append = '', $shadow = 0)
->andWhere('t2.vision')->eq($this->config->vision)
->fetchPairs('id', 'id');
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
$products = $this->dao->select("*, IF(INSTR(' closed', status) < 2, 0, 1) AS isClosed")
->from(TABLE_PRODUCT)
->where(1)
->beginIF(strpos($mode, 'all') === false)->andWhere('deleted')->eq(0)->fi()
+1 -1
View File
@@ -45,7 +45,7 @@ class dbh
*/
public function __construct($config, $setSchema = true)
{
$dsn = "{$config->driver}:host={$config->host}:{$config->port}";
$dsn = "{$config->driver}:host={$config->host};port={$config->port}";
if($setSchema) $dsn .= ";dbname={$config->name}";
$pdo = new PDO($dsn, $config->user, $config->password);
+2 -2
View File
@@ -254,7 +254,7 @@ class buildModel extends model
$buildIdList = str_replace('trunk', '0', $buildIdList);
$selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD)
->where('id')->in($buildIdList)
->beginIF($products)->andWhere('product')->in($productIdList)->fi()
->beginIF($products and $products != 'all')->andWhere('product')->in($productIdList)->fi()
->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi()
->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi()
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi()
@@ -274,7 +274,7 @@ class buildModel extends model
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi()
->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi()
->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi()
->beginIF($products)->andWhere('t1.product')->in($productIdList)->fi()
->beginIF($products and $products != 'all')->andWhere('t1.product')->in($productIdList)->fi()
->beginIF($objectType === 'execution' and $objectID)->andWhere('t1.execution')->eq($objectID)->fi()
->beginIF($objectType === 'project' and $objectID)->andWhere('t1.project')->eq($objectID)->fi()
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
+1 -1
View File
@@ -3319,7 +3319,7 @@ class executionModel extends model
$data->branch = $storyList[$storyID]->branch;
$data->story = $storyID;
$data->version = $versions[$storyID];
$data->order = ++$lastOrder;
$data->order = (int)++$lastOrder;
$this->dao->replace(TABLE_PROJECTSTORY)->data($data)->exec();
$this->story->setStage($storyID);
+1
View File
@@ -244,6 +244,7 @@ class productModel extends model
*/
public function getById($productID)
{
$productID = (int)$productID;
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProduct();
$product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch();
if(!$product) return false;