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

接口

... ... @@ -23,7 +23,7 @@ class SignController extends RestBaseController
*/
public function index()
{
$this->getUserId();
$user_id=$this->getUserId();
$re=Db::name('config')->where('id',1)->find();
$data['morning_sign_time']=date('H:i',$re['morning_sign_time']);
... ... @@ -38,7 +38,7 @@ class SignController extends RestBaseController
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
$endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
$user_sign=Db::name('user_sign')->where(['user_id'=>$this->getUserId(),'create_time'=>[ 'between time', [$beginToday,$endToday]]])->find();
$user_sign=Db::name('user_sign')->where(['user_id'=>$user_id,'create_time'=>[ 'between time', [$beginToday,$endToday]]])->find();
if ($time>$data['morning_sign_time']&&$time<$data['morning_sign_end_time']){
if ($user_sign['morning']!=null) {
$data['sign'] = 0;
... ...