-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEPGColumnAction.class.php
More file actions
792 lines (663 loc) · 21.4 KB
/
EPGColumnAction.class.php
File metadata and controls
792 lines (663 loc) · 21.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
<?php
class EPGColumnAction extends Action
{
public function remove()
{
if(!isset($_REQUEST["ID"]))
{
return false;
}
$ID = $_REQUEST["ID"];
//commandrecord
$userid=Session::get('userid');
$command=new commonAction();
$commandLine=' EPGColumnAction/remove';
$params='ID='.$ID;
$command->recordCommand($commandLine, $params, $userid);
$table = New Model('epgcolumn');
$table->startTrans();
$checkrecord=$table->where('ID='.$ID)->find();
if(isset($checkrecord))
{
$checkroot=$table->where('epgversionid='.$checkrecord['epgversionid'].' and parentid=0')->find();
}else{
$this->error('the record is not exist!');
}
$treeItem= new treeItemAction();
$treeItem->remove('epgcolumn');
if($this->checkValues($checkrecord['epgversionid'])==false)
{
$table->rollback();
$this->error('该编播表数据有误,本次操作无效,请导出再导入尝试解决');
}
$table->commit();
$this->success(true);
}
//input:Jason ,output:success/error
public function addAll()
{
$epgversionid=$_REQUEST['ID'];
$input_json=$_REQUEST['data'];
$table=new Model('epgcolumn');
$timestamp = time();
Log::write('epgversion_addAll:Timestampstart:'.$timestamp,Log::DEBUG);
if(json_decode($input_json) == NULL)
{
$this->error("not valid json!");
}else
{
$tableArray = json_decode($input_json,true);
}
//how to calculate the treeLeft & treeRight &parentid?
//step1: read the root record from the json object
foreach ($tableArray as $key => $value)
{
if($value['level']==1)
{
$rootid=$value['parentID'];
break;
}
}
foreach ($tableArray as $key => $value)
{
$tableArray[$key]['epgversionid']=$epgversionid;
}
$epgcolumn=new Model('epgcolumn');
//step2: delete the records of the root including it's children
if(isset($rootid))
{
$epgcolumn->execute("delete from epgcolumn where level>0 and epgversionid =".$epgversionid);
$epgcolumn->execute("update epgcolumn set treeLeft=1,treeRight=2 where ID=".$rootid);
}else{
$epgcolumn->execute("delete from epgcolumn where level>0 and epgversionid =".$epgversionid);
$epgcolumn->execute("update epgcolumn set treeLeft=1,treeRight=2 where epgversionid=".$epgversionid);
$this->success(true);
}
//step3: add the children of the root using add()function ,order by position
$tmparray=Array();
$tmparray[$rootid]=$rootid;
while(!empty($tmparray))
{
$resultArray=array();
foreach ($tmparray as $key => $value)
{
$tmp=$this->addchildren($value,$tableArray,$key);
$resultArray=$resultArray+$tmp;
}
$tmparray=$resultArray;
}
$this->success(true);
}
public function updateItems()
{
$input_json=$_REQUEST['data'];
if(json_decode($input_json) == NULL)
{
$this->error("not valid json!");
}else
{
$tableArray = json_decode($input_json,true);
}
//commandrecord
$userid=Session::get('userid');
$command=new commonAction();
$commandLine=' EPGColumnAction/updateItems';
$params='input_json='.$input_json;
$command->recordCommand($commandLine, $params, $userid);
$epgversion=new Model('epgcolumn');
//trans begin
$epgversion->startTrans();
foreach($tableArray as $key1=>$value1)
{
$updatestring='';
foreach($value1 as $key2=>$value2)
{
if($updatestring!='')
{
$updatestring=$updatestring.",";
}
$updatestring=$updatestring.$key2.'='."'".$value2."'";
}
$epgversion->execute("update epgcolumn set ".$updatestring." where ID=".$key1);
}
$checkrecord=$epgversion->where('ID='.$key1)->find();
if($this->checkValues($checkrecord['epgversionid'])==false)
{
$table->rollback();
$this->error('该编播表数据有误,本次操作无效,请导出再导入尝试解决');
}
//trans commit
$epgversion->commit();
$this->success(true);
}
public function addchildren($ID,$childrenArray,$rootkey)
{
$resultArray=Array();
//find the childrenArray that parentID is ID
if(!isset($ID,$childrenArray,$rootkey))
{
return false;
}
for($position=0;$position<count($childrenArray);$position++)
{
reset($childrenArray);
foreach ($childrenArray as $key => $value)
{
if(($value['parentID']==$rootkey)&&($value['position']==$position))
{
$rtID=$this->addOneRecord($value['position'], $ID, $value['name'], $value['type'], $value['level'], $value['beginTime'],
$value['endTime'],$value['IDMaterial'],$value['epgversionid'],$value['fixed']);
$resultArray[$key]=$rtID;
break;
}
}
}
return $resultArray;
}
//return ID from insert operation
public function addOneRecord($position,$parentID,$name,$type,$level,$beginTime,$endTime,$IDMaterial,$epgversionid,$fixed)
{
if(!isset($position,$parentID,$name,$type,$level))
{
return false;
}
$table = New Model('epgcolumn');
$Flag=1;
$table->startTrans();
//取出要新增到该位置的记录信息
$result = $table->query(" select ID,treeLeft,treeRight,position,level ".
" from resourcetree ".
" where position = ".$position.
" and ".
" parentID = ".$parentID.
" and ".
" level = ".$level.
" order by level,position ");
//如果查找不到,说明这条记录占据的是一个空位置,所以就不需要考虑兄弟节点了,只需要在增加
//本条记录后修改父节点
if(($result==false)||(count($result)==0))
{
//插入本记录 treeLeft和treeRight从父结点获得
$condition['ID']=$parentID;
$Parentresult=$table->where($condition)->select();
$data['treeRight']=$Parentresult[0]['treeRight']+1;
$data['treeLeft']=$data['treeRight']-1;
$data['name'] = $name;
$data['parentID'] = $parentID;
$data['position'] = $position;
$data['level'] = $level;
$data['type'] = $type;
$data['beginTime']=$beginTime;
$data['endTime']=$endTime;
$data['IDMaterial']=$IDMaterial;
$data['epgversionid']=$epgversionid;
$data['fixed']=$fixed;
$ID = $table->add($data);
}else
{
$data['treeLeft']=$result[0]['treeLeft'];
$data['treeRight']=$data['treeLeft']+1;
$data['name'] = $name;
$data['parentID'] = $parentID;
$data['position'] = $position;
$data['level'] = $level;
$data['type'] = $type;
$data['beginTime']=$beginTime;
$data['endTime']=$endTime;
$data['IDMaterial']=$IDMaterial;
$data['epgversionid']=$epgversionid;
$data['fixed']=$fixed;
$ID = $table->add($data);
//说明本记录占据了某条记录的位置,要更新右兄弟节点的position
$this->updateBrotherPosition($table, $ID, 1);
//更新右兄弟节点的左右值
$this->updateBrotherLRTree($table,$ID,2,$Flag);
}
//修改父节点的 treeRight这里也需要递归,考虑到父节点也有父节点的情况
$this->updateParentRightTree($table,$ID,2,$Flag);
$table->commit();
return $ID;
}
//delete all children of ID ,including itself
public function deleteAllChildren($ID)
{
if(!isset($ID)) return false;
$epgcolumn=new Model('epgcolumn');
$subresult=$epgcolumn->where('parentID='.$ID)->select();
if(count($subresult)!=0)
{
reset($subresult);
while (list($key, $val) = each($subresult))
{
$this->deleteAllChildren($val['ID']);
}
}
$epgcolumn->where('ID='.$ID)->delete();
}
public function add()
{
if(!isset($_REQUEST["position"]))
{
$this->error("position?");
return;
}
$position = $_REQUEST["position"];
if(!isset($_REQUEST["parentID"]))
{
$this->error("parentID?");
return;
}
$parentID = $_REQUEST["parentID"];
if(!isset($_REQUEST["name"]))
{
$this->error("name?");
return;
}
$name = $_REQUEST["name"];
if(!isset($_REQUEST["beginTime"]))
{
$this->error("beginTime?");
return;
}
$beginTime = $_REQUEST["beginTime"];
if(!isset($_REQUEST["endTime"]))
{
$this->error("endTime?");
return;
}
$endTime = $_REQUEST["endTime"];
if(!isset($_REQUEST["IDMaterial"]))
{
$this->error("IDMaterial?");
return;
}
$IDMaterial= $_REQUEST["IDMaterial"];
if(!isset($_REQUEST["type"]))
{
$this->error("type?");
return;
}
$type= $_REQUEST["type"];
if(!isset($_REQUEST["level"]))
{
$this->error("level?");
return;
}
$level= $_REQUEST["level"];
if(!isset($_REQUEST["epgVersionID"]))
{
$this->error("epgVersionID?");
return;
}
$epgversionid= $_REQUEST["epgVersionID"];
if(!isset($_REQUEST["fixed"]))
{
$this->error("fixed?");
return;
}
$fixed = $_REQUEST["fixed"];
if(isset($_REQUEST['broadcasttype']))
{
$broadcasttype=$_REQUEST['broadcasttype'];
}
if(isset($_REQUEST['firstbroadcast']))
{
$firstbroadcast=$_REQUEST['firstbroadcast'];
}
//commandrecord
$userid=Session::get('userid');
$command=new commonAction();
$commandLine=' EPGColumnAction/add';
$params='position='.$position.'parentID='.$parentID.'name='.$name.'beginTime='.$beginTime.'endTime='.$endTime.
'IDMaterial='.$IDMaterial.'type='.$type.'epgversionid='.$epgversionid.'fixed='.$fixed;
$command->recordCommand($commandLine, $params, $userid);
$data['name']=$name;
$data['beginTime']=$beginTime;
$data['endTime']=$endTime;
$data['IDMaterial']=$IDMaterial;
$data['type']=$type;
$data['level']=$level;
$data['epgversionid']=$epgversionid;
$data['fixed']=$fixed;
if(isset($broadcasttype))
{
$data['broadcasttype'] =$broadcasttype;
}
if(isset($firstbroadcast))
{
$data['firstbroadcast'] =$firstbroadcast;
}
$table=new Model('epgcolumn');
$table->startTrans();
$treeItem=new treeItemAction();
$rt=$treeItem->add('epgcolumn',$data);
//find the root record of ID
//$checkrecord=$table->where('ID='.$rt)->find();
//if(isset($checkrecord))
//{
// $checkroot=$table->where('epgversionid='.$checkrecord['epgversionid'].' and parentid=0')->find();
// $checkresult=$treeItem->checkLRTreeValidation('epgcolumn', $checkroot['ID']);
//}
//if($checkresult==true)
//{
// $table->commit();
//}else{
// $table->rollback();
// $this->error('insert rollback ,maybe there is something wrong');
//}
$checkrecord=$table->where('ID='.$parentID)->find();
if(isset($checkrecord['epgversionid']))
{
if($this->checkValues($checkrecord['epgversionid'])==false)
{
$table->rollback();
$this->error('该编播表数据有误,本次操作无效,请导出再导入尝试解决');
}
}
$table->commit();
$this->success($rt);
}
public function move()
{
if(!isset($_REQUEST["ID"]))
{
$this->error('ID?');
return;
}
$ID = $_REQUEST["ID"];
//将要移动到该位置的position
if(!isset($_REQUEST["position"]))
{
$this->error('position?');
return;
}
$position = $_REQUEST["position"];
//将要移动到该位置的parentID
if(!isset($_REQUEST["parentID"]))
{
$this->error('parentID?');
return;
}
$parentID = $_REQUEST["parentID"];
//commandrecord
$userid=Session::get('userid');
$command=new commonAction();
$commandLine=' EPGColumnAction/move';
$params='ID='.$ID.'$position='.$position.'$parentID='.$parentID;
$command->recordCommand($commandLine, $params, $userid);
$table = New Model("epgcolumn");
$table->startTrans();
$treeItem=new treeItemAction();
$treeItem->move('epgcolumn');
$checkrecord=$table->where('ID='.$ID)->find();
if($this->checkValues($checkrecord['epgversionid'])==false)
{
$table->rollback();
$this->error('该编播表数据有误,本次操作无效,请导出再导入尝试解决');
}
$table->commit();
//返回
$this->success(true);
}
public function updateBrotherLRTree($table,$ID,$dif,$Flag)
{
//更新ID记录的同层下的右兄弟节点
if(!isset($table,$ID,$dif,$Flag))
{
$this->error("table?") ;
return;
}
$result = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$ID.
" order by level,position");
$tmpparentID=$result[0]["parentID"];
$tmptreeRight=$result[0]["treeRight"];
$tmpSql= "select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where parentID = ".$tmpparentID.
" and position > ".$result[0]["position"].
" order by level,position";
$resultbrother = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where parentID = ".$tmpparentID.
" and position >=".$result[0]["position"].
" and ID <>".$ID.
" order by level,position");
$countbrother=count($resultbrother);
if($resultbrother!=false)
{
reset($resultbrother);
while (list($key, $val) = each($resultbrother))
{
$tmpID=$val["ID"];
$this->updateSelfLRTree($table,$tmpID,$dif,$Flag);
}
}
return true;
}
//更新右兄弟节点的treeLeft和treeRight的值
public function updateBrotherPosition($table,$ID,$Flag)
{
if(!isset($table,$ID,$Flag))
{
$this->error("table?") ;
return;
}
$result = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$ID.
" order by level,position");
$resultbrother = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where parentID = ".$result[0]["parentID"].
" and position >=".$result[0]["position"]." and ID<>".$ID.
" order by level,position");
$countbrother=count($resultbrother);
if($resultbrother!=false)
{
reset($resultbrother);
while (list($key, $val) = each($resultbrother))
{
$tmpID=$val["ID"];
if($Flag == 0)
{
$table->execute("update epgcolumn set position = position-1 where ID= ".$tmpID);
}elseif ($Flag == 1)
{
$table->execute("update epgcolumn set position = position+1 where ID= ".$tmpID." and ID <>".$ID);
}
}
}
return true;
}
//更新父节点的treeRight值
public function updateParentRightTree($table,$ID,$dif,$Flag)
{
if(!isset($table,$ID,$dif,$Flag))
{
$this->error("table?") ;
return;
}
//查询本节点的父节点是否存在,有则更新
$result = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$ID.
" order by level,position");
$resultParent=$table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$result[0]["parentID"].
" order by level,position");
$countParent=count($resultParent);
if($resultParent !=false)//存在parent
{
//更新parent的rightTree
if($Flag==0)
{
$table->execute("update epgcolumn set treeRight= treeRight -".$dif.
" where ID = ".$resultParent[0]["ID"]);
}elseif($Flag==1)
{
$table->execute("update epgcolumn set treeRight= treeRight +".$dif.
" where ID = ".$resultParent[0]["ID"]);
}
//查询本节点的父节点是否有父节点,如果有则更新父节点的右兄弟节点再更新祖父节点
$tmpPParentSql=" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$resultParent[0]["parentID"].
" order by level,position";
$resultPParent = $table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where ID = ".$resultParent[0]["parentID"].
" order by level,position");
$countPParent=count($resultPParent);
if($resultPParent !=false)
{
//更新父节点的兄弟节点
$this->updateBrotherLRTree($table,$resultParent[0]["ID"],$dif,$Flag);
//更新父节点的父节点
$this->updateParentRightTree($table,$resultParent[0]["ID"],$dif,$Flag);
}
}
return true;
}
//更新一个ID下面包括自身的其子节点的treeLeft和treeRight,删除节点导致这两个值减少dif,这个函数改为更新自己
public function updateSelfLRTree($table,$ID,$dif,$Flag)
{
if(!isset($table,$ID,$dif,$Flag))
{
$this->error("table?") ;
return;
}
//更新本节点的treeLeft和treeRight信息
if($Flag==0)
{
$table->execute("update epgcolumn set treeLeft= treeLeft-".$dif.",treeRight = treeRight-".$dif.
" where ID = ".$ID);
}elseif($Flag==1){
$table->execute("update epgcolumn set treeLeft= treeLeft+".$dif.",treeRight = treeRight+".$dif.
" where ID = ".$ID);
}
//查询本节点的父节点,自身level更新为父节点的level+1
$selfresult=$table->query("select * from epgcolumn where ID =".$ID);
$parentresult=$table->query("select * from epgcolumn where ID =".$selfresult[0]['parentID']);
if($parentresult!=false){
$updatelevel=$parentresult[0]['level']+1;
$table->execute("update epgcolumn set level = ".$updatelevel.
" where ID = ".$ID);
}
//查询是否本节点是否有子节点,如果有,也更新子节点的treeLeft和treeRight信息
$sub_restult=$table->query(" select ID,parentID,treeLeft,treeRight,position,level ".
" from epgcolumn ".
" where parentID = ".$ID);
$resultcount = count(sub_restult);
if($sub_restult!=false)
{
reset($sub_restult);
while (list($key, $val) = each($sub_restult))
{
$tmpID=$val["ID"];
$this->updateSelfLRTree($table,$tmpID,$dif,$Flag);
}
}
return true;
}
//检查重要的数据
public function checkValues($ID)
{
$treevalueresult=$this->checktreeValue($ID);
$posvalueresult=$this->checkpositionValue($ID);
return ($treevalueresult)&&($posvalueresult);
}
//快速treeleft treeright的校验方法
public function checktreeValue($ID)
{
$epgTable=new Model();
$result1=$epgTable->query(" select (max(treeright)+1)*max(treeright) div 2 as total1 from epgcolumn where epgversionid=".$ID);
$result2=$epgTable->query(" select (sum(treeleft)+sum(treeright)) as total2 from epgcolumn where epgversionid=".$ID);
if($result1[0]['total1']!=$result2[0]['total2'])
{
return false;
}
return true;
}
public function checkpositionValue($epgversionid)
{
$epgcolumntable=new Model('epgcolumn');
$propositionresult=$epgcolumntable->query(" select * from epgcolumn where level=1 and epgversionid=".$epgversionid." order by position,beginTime,endTime");
foreach($propositionresult as $proposkey=>$proposvalue)
{
if($proposkey!=$proposvalue['position'])
{
return false;
}
$subposresult=$epgcolumntable->query(" select * from epgcolumn where parentID=".$proposvalue['ID']." order by position,beginTime,endTime");
foreach($subposresult as $subposkey=>$subposvalue)
{
if($subposkey!=$subposvalue['position'])
{
return false;
}
$maposresult=$epgcolumntable->query(" select * from epgcolumn where parentID=".$subposvalue['ID']." order by position,beginTime,endTime");
foreach($maposresult as $maposkey=>$maposvalue)
{
if($maposkey!=$maposvalue['position'])
{
return false;
}
}
}
}
return true;
}
public function checkTimeVaule($epgversionid)
{
$epgcolumntable=new Model('epgcolumn');
$treeResult=$this->checktreeValue($epgversionid);
$positionResult=$this->checkpositionValue($epgversionid);
if((($treeResult)&&($positionResult))==false)
{
//('时间接续检查时发现有位序错误');
return false;
}
$proresult=$epgcolumntable->query(" select * from epgcolumn where level=1 and epgversionid=".$epgversionid." order by position");
$subproresult=array();
foreach($proresult as $prokey=>$provalue)
{
$tmpresult=$epgcolumntable->query(" select * from epgcolumn where level=2 and (beginTime!='00:00:00' or endTime!='00:00:00') and epgversionid=".$epgversionid." and parentID=".$provalue['ID']." order by position");
$subproresult=array_merge($subproresult,$tmpresult);
}
//素材接续检查
foreach($subproresult as $subkey=>$subvalue)
{
$materialresult=$epgcolumntable->query(" select * from epgcolumn where parentID=".$subvalue['ID']." order by position");
for($i=0;$i<count($materialresult)-1;$i++)
{
if(($materialresult[$i]['endTime'])!=($materialresult[$i+1]['beginTime']))
{
//($materialresult[$i]['name'].'素材不接续');
if(($materialresult[$i]['fixed']!=0)||($materialresult[$i+1]['fixed'])!=0)
{
continue;
}
return false;
}
}
}
//子栏目接续性检查
for($i=0;$i<count($subproresult)-1;$i++)
{
if(($subproresult[$i]['endTime'])!=($subproresult[$i+1]['beginTime']))
{
//$subproresult[$i]['name'].'子栏目接续有误'
if(($subproresult[$i]['fixed']!=0)||($subproresult[$i+1]['fixed'])!=0)
{
continue;
}
return false;
}
}
return true;
}
}
?>