其余文件
This commit is contained in:
62
app/api/controller/Sign.php
Normal file
62
app/api/controller/Sign.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\api\logic\SignLogic;
|
||||
use app\api\validate\SignValidate;
|
||||
use app\common\basics\Api;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
/**
|
||||
* 签到
|
||||
* Class Sign
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class Sign extends Api
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 签到列表
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/2/17 18:29
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$lists = SignLogic::lists($this->user_id);
|
||||
return JsonServer::success('', $lists);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 签到
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/2/17 18:29
|
||||
*/
|
||||
public function sign()
|
||||
{
|
||||
(new SignValidate())->goCheck(null, ['user_id' => $this->user_id]);
|
||||
$result = SignLogic::sign($this->user_id);
|
||||
if (false === $result) {
|
||||
return JsonServer::error(SignLogic::getError() ?: '签到失败');
|
||||
}
|
||||
return JsonServer::success('', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 签到规则
|
||||
* @return \think\response\Json
|
||||
* @author 段誉
|
||||
* @date 2022/2/17 14:53
|
||||
*/
|
||||
public function rule()
|
||||
{
|
||||
return JsonServer::success('', SignLogic::getRule());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user