|
@@ -238,6 +238,8 @@ class SignController extends RestBaseController |
|
@@ -238,6 +238,8 @@ class SignController extends RestBaseController |
238
|
* @url /portal/Sign/weekSign
|
238
|
* @url /portal/Sign/weekSign
|
239
|
* @method POST
|
239
|
* @method POST
|
240
|
* @header name:XX-Token require:1 default: desc:token
|
240
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
241
|
+ * @return param:各个参数
|
|
|
242
|
+ * @return record:周打卡记录
|
241
|
*/
|
243
|
*/
|
242
|
public function weekSign(){
|
244
|
public function weekSign(){
|
243
|
//用户信息
|
245
|
//用户信息
|
|
@@ -281,4 +283,24 @@ class SignController extends RestBaseController |
|
@@ -281,4 +283,24 @@ class SignController extends RestBaseController |
281
|
'record'=>$record
|
283
|
'record'=>$record
|
282
|
));
|
284
|
));
|
283
|
}
|
285
|
}
|
|
|
286
|
+ /**
|
|
|
287
|
+ * @title 周打卡提交
|
|
|
288
|
+ * @description 周打卡提交接口
|
|
|
289
|
+ * @author panhaowen
|
|
|
290
|
+ * @url /portal/Sign/weekSignPost
|
|
|
291
|
+ * @method POST
|
|
|
292
|
+ * @header name:XX-Token require:1 default: desc:token
|
|
|
293
|
+ * @return param:各个参数
|
|
|
294
|
+ * @return record:周打卡记录
|
|
|
295
|
+ */
|
|
|
296
|
+ public function weekSignPost(){
|
|
|
297
|
+ $param=$this->request->param();
|
|
|
298
|
+ $user=Db::name('user')->where('id',$this->getUserId())->find();
|
|
|
299
|
+ Db::name('user')->where('id',$this->getUserId())->update(['now_weight'=>$param['weight']]);
|
|
|
300
|
+ $paramService=new ParamService();
|
|
|
301
|
+ $param['status']=$paramService->week_status($param['weight'],$user['height']);
|
|
|
302
|
+ Db::name('user_week_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),'weight'=>$param['weight'],'status'=>$param['status']]);
|
|
|
303
|
+ //返回
|
|
|
304
|
+ $this->success('周打卡提交成功');
|
|
|
305
|
+ }
|
284
|
} |
306
|
} |