作者 景龙
1 个管道 的构建 通过 耗费 3 秒

调节个人主页整体的大小

@@ -170,7 +170,7 @@ $configs = [ @@ -170,7 +170,7 @@ $configs = [
170 // 缓存前缀 170 // 缓存前缀
171 'prefix' => '', 171 'prefix' => '',
172 // 缓存有效期 0表示永久缓存 172 // 缓存有效期 0表示永久缓存
173 - 'expire' => 0, 173 + 'expire' => 3600,
174 ], 174 ],
175 // +---------------------------------------------------------------------- 175 // +----------------------------------------------------------------------
176 // | 会话设置 176 // | 会话设置
@@ -25,7 +25,7 @@ class IndexController extends HomeBaseController @@ -25,7 +25,7 @@ class IndexController extends HomeBaseController
25 $coverImg = cache('coverImg'); 25 $coverImg = cache('coverImg');
26 if(!$coverImg){ 26 if(!$coverImg){
27 $coverImg = $this->getCoverImg(CityCategoryModel::indexImg,3); 27 $coverImg = $this->getCoverImg(CityCategoryModel::indexImg,3);
28 - cache('coverImg',$coverImg,86400); 28 + cache('coverImg',$coverImg);
29 } 29 }
30 $this->assign('coverImg',$coverImg); 30 $this->assign('coverImg',$coverImg);
31 31
@@ -52,7 +52,7 @@ class IndexController extends HomeBaseController @@ -52,7 +52,7 @@ class IndexController extends HomeBaseController
52 } 52 }
53 } 53 }
54 } 54 }
55 - cache('res_city', $city,86400);//有效期一天 55 + cache('res_city', $city);
56 } 56 }
57 $this->assign('res_city',$city); 57 $this->assign('res_city',$city);
58 58
@@ -72,51 +72,46 @@ class IndexController extends HomeBaseController @@ -72,51 +72,46 @@ class IndexController extends HomeBaseController
72 } 72 }
73 } 73 }
74 } 74 }
75 - cache('res_month', $month,86400);//有效期一天 75 + cache('res_month', $month);
76 } 76 }
77 $this->assign('res_month',$month); 77 $this->assign('res_month',$month);
78 78
79 //星域秀场->星球影院 79 //星域秀场->星球影院
80 // $res_xqyy = cache('res_xqyy'); 80 // $res_xqyy = cache('res_xqyy');
81 // if(!$res_xqyy){ 81 // if(!$res_xqyy){
82 -// $position = CityCategoryModel::xqyy;  
83 -// $field = 'id,more,thumbnail';  
84 -// $res_xqyy = $this->getVideoIndex($position,$field,1);  
85 -// foreach($res_xqyy as &$value){  
86 -// $video = json_decode($value['more'],true);  
87 -// $value['video'] = $video['video'];  
88 -// }  
89 -// if($res_xqyy){  
90 -// $res_xqyy = $res_xqyy[0];  
91 -// }  
92 -// cache('res_xqyy', $res_xqyy,86400);//有效期一天 82 + $position = CityCategoryModel::xqyy;
  83 + $field = 'id,more,index_thumbnail';
  84 + $res_xqyy = $this->getVideoIndex($position,$field,1);
  85 + foreach($res_xqyy as &$value){
  86 + $video = json_decode($value['more'],true);
  87 + $value['video'] = $video['video'];
  88 + }
  89 + if($res_xqyy){
  90 + $res_xqyy = $res_xqyy[0];
  91 + }
  92 +// cache('res_xqyy', $res_xqyy);
93 // } 93 // }
94 - $position = CityCategoryModel::xqyy;  
95 - $field = 'id,more,index_thumbnail';  
96 - $res_xqyy = $this->getVideoIndex($position,$field,1);  
97 - foreach($res_xqyy as &$value){  
98 - $video = json_decode($value['more'],true);  
99 - $value['video'] = $video['video'];  
100 - }  
101 - if($res_xqyy){  
102 - $res_xqyy = $res_xqyy[0];  
103 - }  
104 $this->assign('res_xqyy',$res_xqyy); 94 $this->assign('res_xqyy',$res_xqyy);
105 95
106 //推广视频 96 //推广视频
107 - $position = CityCategoryModel::xqyy;  
108 - $city_id = CityCategoryModel::djxq;  
109 - $field = 'id,more,thumbnail';  
110 - $res_djxq = $this->getVideo($position,$city_id,$field,1);  
111 - foreach($res_djxq as &$value){  
112 - $video = json_decode($value['more'],true);  
113 - $value['video'] = $video['video'];  
114 - }  
115 - if($res_djxq){  
116 - $res_djxq = $res_djxq[0]; 97 + $res_djxq = cache('res_djxq');
  98 + if(!$res_djxq){
  99 + $position = CityCategoryModel::xqyy;
  100 + $city_id = CityCategoryModel::djxq;
  101 + $field = 'id,more,thumbnail';
  102 + $res_djxq = $this->getVideo($position,$city_id,$field,1);
  103 + foreach($res_djxq as &$value){
  104 + $video = json_decode($value['more'],true);
  105 + $value['video'] = $video['video'];
  106 + }
  107 + if($res_djxq){
  108 + $res_djxq = $res_djxq[0];
  109 + }
  110 + cache('res_djxq', $res_djxq);
117 } 111 }
118 $this->assign('res_djxq',$res_djxq); 112 $this->assign('res_djxq',$res_djxq);
119 113
  114 +
120 //星域秀场->明星访谈 115 //星域秀场->明星访谈
121 $res_mxft = cache('res_mxft'); 116 $res_mxft = cache('res_mxft');
122 if(!$res_mxft){ 117 if(!$res_mxft){
@@ -126,7 +121,7 @@ class IndexController extends HomeBaseController @@ -126,7 +121,7 @@ class IndexController extends HomeBaseController
126 if($res_mxft){ 121 if($res_mxft){
127 $res_mxft = $res_mxft[0]; 122 $res_mxft = $res_mxft[0];
128 } 123 }
129 - cache('res_mxft',$res_mxft,86400); 124 + cache('res_mxft',$res_mxft);
130 } 125 }
131 $this->assign('res_mxft',$res_mxft); 126 $this->assign('res_mxft',$res_mxft);
132 127
@@ -137,7 +132,7 @@ class IndexController extends HomeBaseController @@ -137,7 +132,7 @@ class IndexController extends HomeBaseController
137 $position = CityCategoryModel::xyhl; 132 $position = CityCategoryModel::xyhl;
138 $field = 'id,thumbnail'; 133 $field = 'id,thumbnail';
139 $res_xyhl = $this->getChildArticle($position,$field,16); 134 $res_xyhl = $this->getChildArticle($position,$field,16);
140 - cache('res_xyhl',$res_xyhl,86400); 135 + cache('res_xyhl',$res_xyhl);
141 } 136 }
142 $this->assign('res_xyhl',$res_xyhl); 137 $this->assign('res_xyhl',$res_xyhl);
143 138
@@ -148,7 +143,7 @@ class IndexController extends HomeBaseController @@ -148,7 +143,7 @@ class IndexController extends HomeBaseController
148 $position = CityCategoryModel::xttj; 143 $position = CityCategoryModel::xttj;
149 $field = 'id,post_title,price,index_thumbnail,place'; 144 $field = 'id,post_title,price,index_thumbnail,place';
150 $res_xttj = $this->getParentArticle($position,$field,16); 145 $res_xttj = $this->getParentArticle($position,$field,16);
151 - cache('res_xttj',$res_xttj,86400); 146 + cache('res_xttj',$res_xttj);
152 } 147 }
153 $this->assign('res_xttj',$res_xttj); 148 $this->assign('res_xttj',$res_xttj);
154 149
@@ -159,7 +154,7 @@ class IndexController extends HomeBaseController @@ -159,7 +154,7 @@ class IndexController extends HomeBaseController
159 $position = CityCategoryModel::xjhd; 154 $position = CityCategoryModel::xjhd;
160 $field = 'id,post_title,thumbnail'; 155 $field = 'id,post_title,thumbnail';
161 $res_xjhd = $this->getParentArticle($position,$field,2); 156 $res_xjhd = $this->getParentArticle($position,$field,2);
162 - cache('res_xjhd',$res_xjhd,86400); 157 + cache('res_xjhd',$res_xjhd);
163 } 158 }
164 $this->assign('res_xjhd',$res_xjhd); 159 $this->assign('res_xjhd',$res_xjhd);
165 return $this->fetch(); 160 return $this->fetch();
@@ -196,6 +196,6 @@ body { @@ -196,6 +196,6 @@ body {
196 color: #FFFEFE; 196 color: #FFFEFE;
197 margin-top:30px ; 197 margin-top:30px ;
198 font-size: 16px; 198 font-size: 16px;
199 - margin-bottom: 20px; 199 + /*margin-bottom: 20px;*/
200 /*font-synthesis: 16px;*/ 200 /*font-synthesis: 16px;*/
201 } 201 }
@@ -9,45 +9,45 @@ @@ -9,45 +9,45 @@
9 -ms-transform:translate(-50%,-50%); 9 -ms-transform:translate(-50%,-50%);
10 } 10 }
11 .personal_center { 11 .personal_center {
12 - width: 519px;  
13 - height: 386px; 12 + width: 487px;
  13 + height: 330px;
14 background: rgba(255, 255, 255, 1); 14 background: rgba(255, 255, 255, 1);
15 box-shadow: 0px 32px 36px 2px rgba(0, 0, 0, 0.04); 15 box-shadow: 0px 32px 36px 2px rgba(0, 0, 0, 0.04);
16 border-radius: 20px; 16 border-radius: 20px;
17 margin: 0 auto; 17 margin: 0 auto;
18 - padding: 0 160px;  
19 - padding-top: 94px; 18 + padding: 0 159px;
  19 + padding-top:81px;
20 box-sizing: border-box; 20 box-sizing: border-box;
21 } 21 }
22 22
23 .personal_center_avatar { 23 .personal_center_avatar {
24 - width: 140px;  
25 - height: 140px; 24 + width: 125px;
  25 + height: 125px;
26 background: #fff; 26 background: #fff;
27 border-radius: 50%; 27 border-radius: 50%;
28 - top: -75px; 28 + top: -58px;
29 position: absolute; 29 position: absolute;
30 - left: 191px; 30 + left: 181px;
31 } 31 }
32 32
33 .personal_center_avatar img { 33 .personal_center_avatar img {
34 margin: 5px; 34 margin: 5px;
35 - width:130px;  
36 - height:130px; 35 + width:115px;
  36 + height:115px;
37 border-radius:50%; 37 border-radius:50%;
38 } 38 }
39 39
40 .Editor_avatar, 40 .Editor_avatar,
41 .Modifying, 41 .Modifying,
42 .Collection { 42 .Collection {
43 - height: 64px; 43 + height: 58px;
44 background: rgba(43, 213, 135, 1); 44 background: rgba(43, 213, 135, 1);
45 border-radius: 32px; 45 border-radius: 32px;
46 - padding: 22px 41px; 46 + padding: 20px 32px;
47 box-sizing: border-box; 47 box-sizing: border-box;
48 color: #fff; 48 color: #fff;
49 - font-size: 20px;  
50 - margin-bottom: 24px; 49 + font-size: 18px;
  50 + margin-bottom: 17px;
51 cursor: pointer; 51 cursor: pointer;
52 } 52 }
53 53
@@ -111,8 +111,8 @@ @@ -111,8 +111,8 @@
111 width: 150px; 111 width: 150px;
112 height: 55px; 112 height: 55px;
113 font-size: 12px; 113 font-size: 12px;
114 - right: 185px;  
115 - top: 120px; 114 + right: 167px;
  115 + top: 82px;
116 opacity: 0; 116 opacity: 0;
117 cursor: pointer; 117 cursor: pointer;
118 } 118 }