...
|
...
|
@@ -238,6 +238,8 @@ class SignController extends RestBaseController |
|
|
* @url /portal/Sign/weekSign
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @return param:各个参数
|
|
|
* @return record:周打卡记录
|
|
|
*/
|
|
|
public function weekSign(){
|
|
|
//用户信息
|
...
|
...
|
@@ -281,4 +283,24 @@ class SignController extends RestBaseController |
|
|
'record'=>$record
|
|
|
));
|
|
|
}
|
|
|
/**
|
|
|
* @title 周打卡提交
|
|
|
* @description 周打卡提交接口
|
|
|
* @author panhaowen
|
|
|
* @url /portal/Sign/weekSignPost
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @return param:各个参数
|
|
|
* @return record:周打卡记录
|
|
|
*/
|
|
|
public function weekSignPost(){
|
|
|
$param=$this->request->param();
|
|
|
$user=Db::name('user')->where('id',$this->getUserId())->find();
|
|
|
Db::name('user')->where('id',$this->getUserId())->update(['now_weight'=>$param['weight']]);
|
|
|
$paramService=new ParamService();
|
|
|
$param['status']=$paramService->week_status($param['weight'],$user['height']);
|
|
|
Db::name('user_week_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),'weight'=>$param['weight'],'status'=>$param['status']]);
|
|
|
//返回
|
|
|
$this->success('周打卡提交成功');
|
|
|
}
|
|
|
} |
...
|
...
|
|