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

接口

... ... @@ -94,19 +94,10 @@ class SignController extends RestBaseController
$data['start_time']=$data['sleep_sign_time'];
$data['end_time']=$data['sleep_sign_end_time'];
}
$data['sign']=0;
}
//判断是否需要进行周打卡
if (!Db::name('user_week_sign')->where(['user_id'=>$this->getUserId()])->find()){
$is_week=1;
}
else if (Db::name('user_week_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ '<', $beginToday-(7*24*60*60)]])->find()){
$is_week=1;
}else{
$is_week=0;
}
// $is_week=1;
$this->success('首页信息',array(
... ... @@ -114,7 +105,6 @@ class SignController extends RestBaseController
'slogan'=>$re['slogan'],
'start_time'=>$data['start_time'],
'end_time'=>$data['end_time'],
'is_week'=>$is_week
));
}
... ... @@ -134,6 +124,16 @@ class SignController extends RestBaseController
* @return sleep:睡前打卡记录(null为未进行睡前打卡)
*/
public function daySign(){
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
//判断是否需要进行周打卡
if (!Db::name('user_week_sign')->where(['user_id'=>$this->getUserId()])->find()){
$is_week=1;
}
else if (Db::name('user_week_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ '<', $beginToday-(7*24*60*60)]])->find()){
$is_week=1;
}else{
$is_week=0;
}
// $param=$this->request->param();
// if ($param['status']==1){
// $type='morning';
... ... @@ -156,6 +156,7 @@ class SignController extends RestBaseController
$daySign['sleep']=empty($daySign['sleep'])?null:date('Y/m/d H:i:s',$daySign['sleep']);
//返回
$this->success('日打卡信息',array(
'is_week'=>$is_week,
'all'=>$user['all_sign_day'],
'last'=>$user['stay_sign_day'],
'longest'=>$user['longest_sign_day'],
... ...
... ... @@ -137,7 +137,7 @@ class PublicController extends RestBaseController
if (empty($re['mobile'])){
$this->success(['msg'=>'请先手机号注册!','code'=>'40001'], ['token' => $token]);
}
if ($re['user_status']!=1){
if ($re['user_status']!=1||$re['user_status']!=2){
$this->success(['msg'=>'请先填写用户信息!','code'=>'40002'], ['token' => $token]);
}
$this->success("登录成功!", ['token' => $token]);
... ...