This commit is contained in:
chaideqing
2023-12-25 09:14:09 +08:00
parent 4b05d50253
commit ebec224644
+13
View File
@@ -184,6 +184,19 @@ class releaseModel extends model
*/
public function create($productID = 0, $branch = 0, $projectID = 0)
{
if(empty($projectID))
{
$product = $this->loadModel('product')->getById($productID);
if($product->shadow)
{
$projectID = $this->dao->select('t2.id')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.type')->eq('project')
->fetch('id');
}
}
/* Init vars. */
$productID = $this->post->product ? $this->post->product : (int)$productID;
$branch = $this->post->branch ? $this->post->branch : (int)$branch;