正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
@@ -151,12 +151,15 @@ class SignController extends RestBaseController | @@ -151,12 +151,15 @@ class SignController extends RestBaseController | ||
151 | * @method POST | 151 | * @method POST |
152 | * @header name:XX-Token require:1 default: desc:token | 152 | * @header name:XX-Token require:1 default: desc:token |
153 | * @param name:status type:int require:1 other: desc:日打卡种类 | 153 | * @param name:status type:int require:1 other: desc:日打卡种类 |
154 | + * @return day_sign:是否需要进入每日一签页面(0:不需要,1:需要) | ||
154 | */ | 155 | */ |
155 | public function daySignPost(){ | 156 | public function daySignPost(){ |
156 | $param=$this->request->param(); | 157 | $param=$this->request->param(); |
157 | $user=Db::name('user')->where('id',$this->getUserId())->find(); | 158 | $user=Db::name('user')->where('id',$this->getUserId())->find(); |
158 | $config=[]; | 159 | $config=[]; |
159 | $music=[]; | 160 | $music=[]; |
161 | + //是否需要进入每日一签页面 | ||
162 | + $day_sign=0; | ||
160 | //根据签到种类判断增加积分数 | 163 | //根据签到种类判断增加积分数 |
161 | $score=Db::name('config')->where('id',1)->find(); | 164 | $score=Db::name('config')->where('id',1)->find(); |
162 | if ($param['status']==1){ | 165 | if ($param['status']==1){ |
@@ -209,6 +212,7 @@ class SignController extends RestBaseController | @@ -209,6 +212,7 @@ class SignController extends RestBaseController | ||
209 | } | 212 | } |
210 | //无记录 | 213 | //无记录 |
211 | else{ | 214 | else{ |
215 | + $day_sign=1; | ||
212 | Db::name('user_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),"$type"=>time()]); | 216 | Db::name('user_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),"$type"=>time()]); |
213 | } | 217 | } |
214 | //记录打卡积分 | 218 | //记录打卡积分 |
@@ -223,6 +227,7 @@ class SignController extends RestBaseController | @@ -223,6 +227,7 @@ class SignController extends RestBaseController | ||
223 | 'music'=>cmf_get_file_download_url($music['url']), | 227 | 'music'=>cmf_get_file_download_url($music['url']), |
224 | 'music_name'=>$music['name'], | 228 | 'music_name'=>$music['name'], |
225 | 'score'=>$score, | 229 | 'score'=>$score, |
230 | + 'day_sign'=>$day_sign, | ||
226 | )); | 231 | )); |
227 | } | 232 | } |
228 | 233 |
-
请 注册 或 登录 后发表评论