作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

修改意见

@@ -292,8 +292,10 @@ class SignController extends RestBaseController @@ -292,8 +292,10 @@ class SignController extends RestBaseController
292 292
293 $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 293 $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日
294 $config=Db::name('sign_image')->where('date',$date)->find(); 294 $config=Db::name('sign_image')->where('date',$date)->find();
295 - $music=json_decode($config['music'],true);  
296 - $music=$music[rand(0,count($music,0)-1)]; 295 + if (!empty($config['music'])) {
  296 + $music = json_decode($config['music'], true);
  297 + $music = $music[rand(0, count($music, 0) - 1)];
  298 + }
297 $this->success('渲染数据',array( 299 $this->success('渲染数据',array(
298 'background'=>cmf_get_image_preview_url($config['image']), 300 'background'=>cmf_get_image_preview_url($config['image']),
299 'music'=>cmf_get_file_download_url($music['url']), 301 'music'=>cmf_get_file_download_url($music['url']),