初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\app\sign;
|
||||
|
||||
use app\common\controller\Api;
|
||||
|
||||
/**
|
||||
* 日历签到
|
||||
*/
|
||||
class Handle extends Api
|
||||
{
|
||||
protected $noNeedLogin = [];
|
||||
protected $noNeedRight = ['*'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
|
||||
\app\common\model\fill\Handle::check('app_config','sign');
|
||||
}
|
||||
|
||||
|
||||
// 按月份获取签到记录
|
||||
public function index()
|
||||
{
|
||||
$month = $this->request->post('month');
|
||||
|
||||
$this->success('获取成功', \app\api\model\app\sign\Log::getList($this->auth->id,$month));
|
||||
}
|
||||
|
||||
|
||||
public function sign () {
|
||||
|
||||
|
||||
$month = $this->request->post('month');
|
||||
|
||||
// 获取积分规则
|
||||
$config = \app\common\model\app\Config::getConfig('sign');
|
||||
|
||||
if($config['status'] !=1){
|
||||
$this->error('签到功能暂时停用');
|
||||
}
|
||||
|
||||
$this->success('签到成功', \app\api\model\app\sign\Log::sign($this->auth->id,$month));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user