Skip to content

Commit a0a5b09

Browse files
committed
2017/10/16
1 parent ab1bd9a commit a0a5b09

File tree

16 files changed

+175
-68
lines changed

16 files changed

+175
-68
lines changed

manage/model/webModel.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function menu_edit_save($data){
4040

4141
}
4242
public function menu_del($id){
43+
$this->model->table('web_menu')->where(array('pid'=>$id))->delete();
4344
return $this->model->table('web_menu')->where(array('id'=>$id))->delete();
4445
}
4546
public function pics_list($where){

manage/module/liveMod.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function common_info($id,$status=false)
175175

176176

177177
}
178-
$teacher=model('teacher')->model_list();
178+
$teacher=model('teacher')->model_list(array('uid'=>$user['id']));
179179

180180
$channel = model('device')->channel_list($where);
181181

manage/template/content/info.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ <h4>
8585

8686
});
8787
</script>
88-
89-
88+
<?php } ?>
89+
<?php if(!$user['cid']&&$user['gid']!=6){ ?>
9090
<tr>
9191
<td>所属科目</td>
9292
<td>

manage/template/live/info.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ <h4>
8686
});
8787
</script>
8888

89-
89+
90+
<?php if(!$user['cid']&&$user['gid']!=6){ ?>
9091
<tr>
9192
<td>所属科目</td>
9293
<td><select name="sid" reg="." id="sid" onchange="changeteacher()" >
@@ -148,6 +149,7 @@ <h4>
148149

149150

150151
</script>
152+
<?php } ?>
151153
<tr>
152154
<td>所属老师</td>
153155
<td><select name="tid" reg="." id="tid" >

model/categoryModel.class.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ public function nav($id)
9595
if(empty($data)){
9696
return;
9797
}
98-
$cat = $cat->getPath($data, $id);
99-
return $cat;
98+
$catname = $cat->getPath($data, $id);
99+
unset($data); unset($cat);
100+
return $catname;
100101
}
101102

102103
//栏目树
@@ -114,6 +115,7 @@ public function getcat($cid)
114115
if(empty($cat_for)){
115116
return $id;
116117
}
118+
unset($data); unset($cat);
117119
foreach ($cat_for as $v) {
118120
$cat_id .= $v['cid'] . ",";
119121
}

model/webModel.class.php

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public function menu_list($where){
2525
$data=$this->model->table('web_menu')->field('id,name,pid')->where($where)->order('sequence desc,id asc')->select();
2626

2727
$cat = new Category(array('id', 'pid', 'name', 'cname'));
28-
return $cat->getTree($data, 0);
28+
$temp=$cat->getTree($data, 0);
29+
unset($cat); unset($cat);
30+
return $temp;
2931
}
3032
public function menu_add_save($data){
3133
return $this->model->table('web_menu')->data($data)->insert();
@@ -58,6 +60,7 @@ public function pics_edit_save($data){
5860
//栏目导航
5961
public function nav($id,$where)
6062
{
63+
6164
$data = $this->model->field('id,pid,name')->table('web_menu')->where($where)->select();
6265
$cat = new Category(array(
6366
'id',
@@ -68,15 +71,17 @@ public function nav($id,$where)
6871
if(empty($data)){
6972
return;
7073
}
71-
$cat = $cat->getPath($data, $id);
72-
return $cat;
74+
$catname = $cat->getPath($data, $id);
75+
76+
unset($data); unset($cat);
77+
return $catname;
7378
}
7479

7580
//栏目树
7681
public function getcat($id,$where)
7782
{
78-
$id = $cid;
7983
$data = $this->model->field('id,pid,name')->table('web_menu')->where($where)->select();
84+
8085
$cat = new Category(array(
8186
'id',
8287
'pid',
@@ -90,14 +95,32 @@ public function getcat($id,$where)
9095
foreach ($cat_for as $v) {
9196
$cat_id .= $v['id'] . ",";
9297
}
93-
98+
unset($data); unset($cat_for); unset($cat);
9499
if (!empty($cat_id)) {
95100
return $cat_id . $id;
96101
} else {
97102
return $id;
98103
}
99104
}
100105

106+
107+
//栏目树
108+
public function getcatname($id,$where)
109+
{
110+
$data = $this->model->field('id,pid,name')->table('web_menu')->where($where)->select();
111+
112+
$cat = new Category(array(
113+
'id',
114+
'pid',
115+
'name',
116+
'cname')); //初始化无限分类
117+
118+
$cat_for = $cat->getTree($data, $id); //获取分类数据树结构
119+
unset($data); unset($cat);
120+
return $cat_for;
121+
122+
}
123+
101124
//栏目树
102125
public function getmids($where)
103126
{
@@ -118,14 +141,40 @@ public function getmids($where)
118141
else
119142
$cat_id .="," . $v['id'] ;
120143
}
121-
144+
unset($data); unset($cat_for); unset($cat);
122145
if (!empty($cat_id)) {
123146
return $cat_id ;
124147
} else {
125148
return $id;
126149
}
127150
}
128151

152+
public function getliveaids($where)
153+
{
154+
echo $loop="
155+
SELECT B.aid
156+
FROM {$this->model->pre}content A
157+
LEFT JOIN {$this->model->pre}expand_content_livestream B ON A.Aid = B.Aid
158+
WHERE {$where}
159+
";
160+
$data = $this->model->query($loop);
161+
162+
if(empty($data)){
163+
return 0;
164+
}
165+
foreach ($data as $k=>$v) {
166+
if(!$k)$cat_id= $v['aid'];
167+
else
168+
$cat_id .="," . $v['aid'] ;
169+
}
170+
unset($data);
171+
if (!empty($cat_id)) {
172+
return $cat_id ;
173+
} else {
174+
return 0;
175+
}
176+
}
177+
129178
//内容列表
130179
public function content_list($where,$limit)
131180
{

module/commonMod.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ public function __construct(){
4949
}
5050
$this->config['uid']=1;
5151
if($admininfo){
52+
5253
$this->config['child']=1;
5354
$this->config['school']=$admininfo['nicename'];
5455
$this->config['uid']=$admininfo['id'];
55-
$_SESSION['sid']=$admininfo['cid'];
56+
//$_SESSION['sid']=$admininfo['cid'];
5657
if($admininfo['logo'])
5758
$this->config['logo']=$admininfo['logo'];
5859
$this->config['sitename']=$admininfo['sitename'];
@@ -61,17 +62,22 @@ public function __construct(){
6162
if($admininfo['copyright'])$this->config['copyright']=$admininfo['copyright'];
6263

6364
}
65+
6466
if($webconfig){
6567
if(!$webconfig['isopen'])$this->alert('站点已经关闭');
6668
$this->config['child']=1;
6769
$this->config['uid']=$webconfig['uid'];
6870
$this->adminuser=model('user')->adminuser($webconfig['uid']);
71+
6972
if($webconfig['logo'])
7073
$this->config['logo']=$webconfig['logo'];
7174
$this->config['sitename']=$webconfig['name'];
7275
$this->config['erweima']=$webconfig['erweima']?$this->config['imageurl'].$webconfig['erweima']:'/public/erweima.jpg';
76+
$this->config['gid']=$this->adminuser['gid'];
77+
7378
$this->webconfig=$webconfig;
74-
$this->menulist=model('web')->menu_list(array('uid'=>$this->config['uid'],'type'=>'cid'));
79+
unset($webconfig);
80+
//$this->menulist=model('web')->menu_list(array('uid'=>$this->config['uid'],'type'=>'cid'));
7581
}
7682
$userinfo=$_COOKIE[$this->config['SPOT'].'_wxuser'];
7783

module/contentMod.class.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ public function index()
9393

9494
if($this->webconfig){
9595
$whereuid=array('uid'=>$this->config['uid']);
96-
$this->menuinfo=model('web')->menu_info(array('id'=>$info['mid']));
96+
$midname=$this->config['gid']==6?'gmid':'mid';
97+
$this->menuinfo=model('web')->menu_info(array('id'=>$info[$midname]));
9798
//位置导航
98-
$this->nav=array_reverse(model('web')->nav($info['mid'], $whereuid));
99+
$this->nav=array_reverse(model('web')->nav($info[$midname], $whereuid));
99100

100101
$this->parent_category = model('web')->menu_info(array('id'=>$this->menuinfo['pid']));
101102

@@ -294,8 +295,8 @@ public function index()
294295
model('content')->views_content($info['aid'],$info['views']);
295296

296297

297-
$zidingyi=unserialize($info_content['zidingyi']);
298-
$this->zidingyi=$zidingyi;
298+
//$zidingyi=unserialize($info_content['zidingyi']);
299+
// $this->zidingyi=$zidingyi;
299300
$this->functions=model('content')->functions_list(array('aid'=>$info['aid']));
300301

301302

@@ -314,8 +315,8 @@ public function index()
314315
$this->desimage=model('content')->getdesimage($info['csid']);
315316

316317

317-
$this->info=$info;
318-
318+
319+
319320
if ($info["cid"] == 16) {
320321

321322
$this->channel=model('content')->channel($info['channel']);
@@ -331,11 +332,12 @@ public function index()
331332
$this->subscribe='subscribe';
332333
}
333334

334-
335-
if($info['tpl']&&MOBILE){
335+
$this->info=$info;
336+
unset($info);
337+
if($this->info['tpl']&&MOBILE){
336338

337339

338-
$this->display($info['tpl']);
340+
$this->display($this->info['tpl']);
339341

340342
}else{
341343
if($_GET['frame']){

module/menulistMod.class.php

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,66 @@ public function index()
3636

3737

3838
$url=__INDEX__.'/menulis/index/id-'.$id.'-page-{page}.html';
39-
39+
$midname=$this->config['gid']==6?'gmid':'mid';
4040
//设置栏目属性
4141
if ($this->info['pid'] == 0) {
42+
4243
$son_id = model('web')->getcat($this->info['id'], $whereuid);
43-
if($son_id)
44-
$where = 'A.status=1 AND A.mid in (' . $son_id . ') ';
44+
45+
46+
if($son_id){
47+
$where = 'A.status=1 AND A.'.$midname.' in (' . $son_id . ') ';
48+
$this->sons= model('web')->getcatname($this->info['id'], $whereuid);
49+
$this->fid=$this->info['id'];
50+
51+
}
4552
else
46-
$where = 'A.status=1 AND A.mid=' . $this->info['id'];
53+
$where = 'A.status=1 AND A.'.$midname.'=' . $this->info['id'];
4754
} else {
48-
$where = 'A.status=1 AND A.mid=' . $this->info['id'];
55+
$where = 'A.status=1 AND A.'.$midname.'=' . $this->info['id'];
56+
57+
$son_id = model('web')->getcat($this->info['pid'], $whereuid);
58+
59+
60+
if($son_id){
61+
62+
$this->sons= model('web')->getcatname($this->info['pid'], $whereuid);
63+
$this->fid=$this->info['pid'];
64+
65+
}
4966
}
67+
5068
$keyword=urldecode($_GET['s']);
5169
if($keyword){
5270
$where.= ' and A.title like "%' . $keyword . '%" ';
5371
$url=__INDEX__.'/menulis/index/id-'.$id.'-s-'.urlencode($keyword).'-page-{page}.html';
5472
}
55-
73+
if($_GET['status']){
74+
$time=time();
75+
switch ($_GET['status']) {
76+
case "wait":
77+
$wherelive=$where.' and B.starttime>'.$time;
78+
$aids=model('web')->getliveaids($wherelive);
79+
$where.=' and A.aid in ('.$aids.')';
80+
break;
81+
case "now":
82+
$wherelive=$where.' and B.starttime<'.$time.' and (B.starttime+60*B.time)>'.$time;
83+
84+
$aids=model('web')->getliveaids($wherelive);
85+
86+
$where.=' and A.aid in ('.$aids.')';
87+
88+
break;
89+
case "over":
90+
$wherelive=$where.' and A.cid=16 and (starttime+60*time)>'.$time;
91+
92+
$aids=model('web')->getliveaids($wherelive);
93+
$where.=' and A.aid not in ('.$aids.')';
94+
95+
break;
96+
}
97+
98+
}
5699
if($this->webconfig['template']=='res'){
57100
$dataarray=model('diyfield')->field_list_data(7);
58101
$this->cat =$cat= new Category(array('id', 'pid', 'name', 'cname'));

system/lib/Category.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function getChild($pid,$data=array())
8080
if($Category[$this->field['pid']]==$pid)
8181
$childs[]=$Category;
8282
}
83+
unset($data);
8384
return $childs;
8485
}
8586

@@ -163,6 +164,7 @@ private function _getPid($id)
163164

164165
if($this->rawList[$key][$this->field['id']]==$id)
165166
{
167+
//var_dump($this->rawList[$key]);die;
166168
$this->formatList[]=$this->rawList[$key];
167169
return $this->rawList[$key][$this->field['pid']];
168170
}

themes/html/mobile/music/css/style.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,5 +1476,7 @@ body{
14761476
overflow: hidden;
14771477
text-overflow:ellipsis;
14781478
white-space: nowrap;
1479-
width:75%;
1479+
width: 75%;
1480+
display: inline-block;
1481+
line-height: 50px;
14801482
}

themes/kunming/css/main.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,12 @@ div.timg img{
564564
.listmain{
565565
margin-bottom:65px;
566566
}
567-
568-
569-
567+
.listmain .fl_nav{
568+
margin-bottom:0;
569+
}
570+
.listmain .res_nav{
571+
margin-top:35px;
572+
}
570573

571574

572575

themes/kunming/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<div class="headbg">
2828
<div class="headlogo">
29-
<img src="img/logo.png"/>
29+
<img src="{$sys.imageurl}{$sys.logo}"/>
3030
</div>
3131
</div>
3232

themes/kunming/img/logo.png

2.43 KB
Loading

0 commit comments

Comments
 (0)