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

接口

@@ -220,7 +220,6 @@ class SignController extends RestBaseController @@ -220,7 +220,6 @@ class SignController extends RestBaseController
220 220
221 //返回 221 //返回
222 $this->success('日打卡提交结果',array( 222 $this->success('日打卡提交结果',array(
223 - 'score'=>$score,  
224 'day_sign'=>$day_sign, 223 'day_sign'=>$day_sign,
225 )); 224 ));
226 } 225 }
@@ -236,9 +235,24 @@ class SignController extends RestBaseController @@ -236,9 +235,24 @@ class SignController extends RestBaseController
236 * @return background:背景图片 235 * @return background:背景图片
237 * @return music:背景音乐 236 * @return music:背景音乐
238 * @return music_name:背景音乐名称 237 * @return music_name:背景音乐名称
  238 + * @return score:签到积分
239 */ 239 */
240 public function day_sign() 240 public function day_sign()
241 { 241 {
  242 + $param=$this->request->param();
  243 + $score=Db::name('config')->where('id',1)->find();
  244 + if ($param['status']==1){
  245 + //早签到积分
  246 + $score=$score['morning_sign_score'];
  247 + }elseif ($param['status']==2){
  248 + $score=$score['noon_sign_score'];
  249 + }elseif ($param['status']==3){
  250 + $score=$score['night_sign_score'];
  251 + }elseif ($param['status']==4){
  252 + $score=$score['sleep_sign_score'];
  253 + }
  254 +
  255 +
242 $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 256 $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日
243 $config=Db::name('sign_image')->where('date',$date)->find(); 257 $config=Db::name('sign_image')->where('date',$date)->find();
244 $music=json_decode($config['music'],true); 258 $music=json_decode($config['music'],true);
@@ -247,6 +261,7 @@ class SignController extends RestBaseController @@ -247,6 +261,7 @@ class SignController extends RestBaseController
247 'background'=>cmf_get_image_preview_url($config['image']), 261 'background'=>cmf_get_image_preview_url($config['image']),
248 'music'=>cmf_get_file_download_url($music['url']), 262 'music'=>cmf_get_file_download_url($music['url']),
249 'music_name'=>$music['name'], 263 'music_name'=>$music['name'],
  264 + 'score'=>$score,
250 )); 265 ));
251 } 266 }
252 267