* [task#133003,done,0.1h] fix conflict.

This commit is contained in:
zhouxin
2024-11-25 09:47:36 +08:00
committed by 綦新志
parent 194ec86d85
commit 46658db9ca
2 changed files with 23 additions and 8 deletions
+1 -2
View File
@@ -115,9 +115,8 @@ class pivotModel extends model
*/
public function getPivotSpec(int $pivotID, string $version, bool $processDateVar = false, bool $addDrills = true)
{
$pivot = $this->dao->select('*')->from(TABLE_PIVOTSPEC)->where('pivot')->eq($pivotID)->andWhere('version')->eq($version)->fetch();
$pivot = $this->pivotTao->fetchPivot($pivotID, $version);
if(!$pivot) return false;
$pivot->id = $pivot->pivot;
$pivot->fieldSettings = array();
if(!empty($pivot->fields) && $pivot->fields != 'null')
+22 -6
View File
@@ -6,17 +6,33 @@ class pivotTao extends pivotModel
* 获取透视表。
* Fetch pivot by id.
*
* @param int $id
* @param int $id
* @param string|null $version
* @access public
* @return object|bool
*/
protected function fetchPivot(int $id): object|bool
protected function fetchPivot(int $id, string|null $version = null): object|bool
{
return $this->dao->select('t1.*, t2.*')->from(TABLE_PIVOT)->alias('t1')
->leftJoin(TABLE_PIVOTSPEC)->alias('t2')->on('t1.id=t2.pivot and t1.version=t2.version')
->where('t1.id')->eq($id)
->andWhere('t1.deleted')->eq('0')
if(is_null($version))
{
return $this->dao->select('t1.*, t2.*')->from(TABLE_PIVOT)->alias('t1')
->leftJoin(TABLE_PIVOTSPEC)->alias('t2')->on('t1.id=t2.pivot and t1.version=t2.version')
->where('t1.id')->eq($id)
->andWhere('t1.deleted')->eq('0')
->fetch();
}
$pivot = $this->dao->select('*')->from(TABLE_PIVOT)->where('id')->eq($id)->andWhere('deleted')->eq('0')->fetch();
if(!$pivot) return false;
$specData = $this->dao->select('*')->from(TABLE_PIVOTSPEC)
->where('pivot')->eq($id)
->andWhere('version')->eq($version)
->fetch();
if(!$specData) return $pivot;
foreach($specData as $specKey => $specValue) $pivot->$specKey = $specValue;
return $pivot;
}
/**