作者 赵彬吉

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -22,7 +22,7 @@ class MailController extends BaseController @@ -22,7 +22,7 @@ class MailController extends BaseController
22 //获取当前用户下的所有站内信 22 //获取当前用户下的所有站内信
23 $lists = $mailModel->where('status',0) 23 $lists = $mailModel->where('status',0)
24 ->where('user_list','like','%,'.$this->uid.',%')->orWhere('user_list', '')->select(['*'])->orderBy($this->order,'desc') 24 ->where('user_list','like','%,'.$this->uid.',%')->orWhere('user_list', '')->select(['*'])->orderBy($this->order,'desc')
25 - ->get(); 25 + ->paginate($this->row, ['*'], 'page', $this->page);
26 if(!empty($lists)){ 26 if(!empty($lists)){
27 $lists = $lists->toArray(); 27 $lists = $lists->toArray();
28 } 28 }
@@ -133,9 +133,11 @@ class CountLogic extends BaseLogic @@ -133,9 +133,11 @@ class CountLogic extends BaseLogic
133 ->select('referrer_url', DB::raw('COUNT(*) as count'))->groupBy('referrer_url') 133 ->select('referrer_url', DB::raw('COUNT(*) as count'))->groupBy('referrer_url')
134 ->orderByDesc('count')->limit(8)->get()->toArray(); 134 ->orderByDesc('count')->limit(8)->get()->toArray();
135 $total = DB::table('gl_customer_visit')->count(); 135 $total = DB::table('gl_customer_visit')->count();
136 - $data = object_to_array($data);  
137 - foreach ($data as $k=>$v){  
138 - $data[$k]['proportion'] = ($v['count']/$total) * 100; 136 + if(!empty($data)){
  137 + $data = object_to_array($data);
  138 + foreach ($data as $k=>$v){
  139 + $data[$k]['proportion'] = ($v['count']/$total) * 100;
  140 + }
139 } 141 }
140 return $this->success($data); 142 return $this->success($data);
141 } 143 }
@@ -150,10 +152,12 @@ class CountLogic extends BaseLogic @@ -150,10 +152,12 @@ class CountLogic extends BaseLogic
150 $data = DB::table('gl_customer_visit') 152 $data = DB::table('gl_customer_visit')
151 ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) 153 ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
152 ->groupBy('country')->orderBy('ip','desc')->limit(20)->get()->toArray(); 154 ->groupBy('country')->orderBy('ip','desc')->limit(20)->get()->toArray();
153 - $data = object_to_array($data);  
154 - foreach ($data as $k => $v){  
155 - $v['pv'] = (int)$v['pv'];  
156 - $data[$k] = $v; 155 + if(!empty($data)){
  156 + $data = object_to_array($data);
  157 + foreach ($data as $k => $v){
  158 + $v['pv'] = (int)$v['pv'];
  159 + $data[$k] = $v;
  160 + }
157 } 161 }
158 return $this->success($data); 162 return $this->success($data);
159 } 163 }
@@ -186,8 +186,10 @@ class Project extends Base @@ -186,8 +186,10 @@ class Project extends Base
186 public function getNoticeFileAttribute($value) 186 public function getNoticeFileAttribute($value)
187 { 187 {
188 $value = Arr::s2a($value); 188 $value = Arr::s2a($value);
189 - foreach ($value as &$v) {  
190 - $v = Upload::path2url($v); 189 + if(!empty($value)){
  190 + foreach ($value as &$v) {
  191 + $v = Upload::path2url($v);
  192 + }
191 } 193 }
192 return $value; 194 return $value;
193 } 195 }
@@ -203,8 +205,10 @@ class Project extends Base @@ -203,8 +205,10 @@ class Project extends Base
203 public function getConfirmFileAttribute($value) 205 public function getConfirmFileAttribute($value)
204 { 206 {
205 $value = Arr::s2a($value); 207 $value = Arr::s2a($value);
206 - foreach ($value as &$v) {  
207 - $v = Upload::path2url($v); 208 + if(!empty($value)) {
  209 + foreach ($value as &$v) {
  210 + $v = Upload::path2url($v);
  211 + }
208 } 212 }
209 return $value; 213 return $value;
210 } 214 }