...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
namespace api\portal\controller;
|
|
|
use cmf\controller\RestBaseController;
|
|
|
use Think\Db;
|
|
|
use api\portal\service\ParamService;
|
|
|
/**
|
|
|
* @title 签到
|
|
|
* @description 签到相关接口
|
...
|
...
|
@@ -98,7 +99,6 @@ class SignController extends RestBaseController |
|
|
* @url /portal/Sign/daySign
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @param
|
|
|
*/
|
|
|
public function daySign(){
|
|
|
//用户信息
|
...
|
...
|
@@ -219,7 +219,6 @@ class SignController extends RestBaseController |
|
|
* @url /portal/Sign/share
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @param
|
|
|
*/
|
|
|
public function share()
|
|
|
{
|
...
|
...
|
@@ -230,4 +229,37 @@ class SignController extends RestBaseController |
|
|
Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>$config['share_score'],'now_score'=>$user['score']]);
|
|
|
$this->success('分享成功');
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 周打卡页面
|
|
|
* @description 麦夫子周打卡页面页面渲染
|
|
|
* @author panhaowen
|
|
|
* @url /portal/Sign/weekSign
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
*/
|
|
|
public function weekSign(){
|
|
|
//用户信息
|
|
|
$user=Db::name('user')->where('id',$this->getUserId())->find();
|
|
|
//判断是否是第一次周打卡
|
|
|
$re=Db::name('user_week_sign')->where('user_id',$user['id'])->find();
|
|
|
if (!$re){
|
|
|
$param['pregnant_week']=$user['pregnant_week'];
|
|
|
$param['day']=ceil((time()-$user['register_time'])/(60*60*21));
|
|
|
$param['weight']=$user['before_weight'];
|
|
|
$paramService=new ParamService();
|
|
|
|
|
|
}
|
|
|
//返回
|
|
|
$this->success('日打卡信息',array(
|
|
|
'all'=>$user['all_sign_day'],
|
|
|
'last'=>$user['stay_sign_day'],
|
|
|
'longest'=>$user['longest_sign_day'],
|
|
|
'morning'=>$daySign['morning'],
|
|
|
'noon'=>$daySign['noon'],
|
|
|
'night'=>$daySign['night'],
|
|
|
'sleep'=>$daySign['sleep'],
|
|
|
));
|
|
|
}
|
|
|
} |
...
|
...
|
|