Merge branch release/21.7.5 of zentao/zentaopms (#10962)

This commit is contained in:
刘刚
2025-08-15 10:29:12 +08:00
committed by Gitfox
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -273,6 +273,7 @@ class blockModel extends model
->markRight(1)
->andWhere('vision')->eq($block->vision)
->andWhere('hidden')->eq('0')
->andWhere('account')->eq($this->app->user->account)
->fetch('top');
if(!$top) $top = 0;
@@ -25,6 +25,12 @@ title=测试 blockModel->getByID();
timeout=0
cid=1
- 测试新加入的区块宽度为2的时候,top是否为6。 @6
- 测试新加入的区块宽度为1的时候,top是否为15。 @15
- 测试新加入的区块宽度为3的时候,top是否为3。 @3
- width为0的时候,仍然是3 @3
- width为100的时候,仍然是3 @3
*/
global $tester;
@@ -44,3 +50,21 @@ $block->dashboard = 'my';
$block->width = '1';
$block->vision = 'rnd';
r($tester->block->computeBlockTop($block)) && p('') && e('15'); // 测试新加入的区块宽度为1的时候,top是否为15。
$block = new stdclass();
$block->dashboard = 'my';
$block->width = '3';
$block->vision = 'rnd';
r($tester->block->computeBlockTop($block)) && p('') && e('3'); // 测试新加入的区块宽度为3的时候,top是否为3。
$block = new stdclass();
$block->dashboard = 'my';
$block->width = '0';
$block->vision = 'rnd';
r($tester->block->computeBlockTop($block)) && p('') && e('3'); // width为0的时候,仍然是3
$block = new stdclass();
$block->dashboard = 'my';
$block->width = '100';
$block->vision = 'rnd';
r($tester->block->computeBlockTop($block)) && p('') && e('3'); // width为100的时候,仍然是3