46 lines
960 B
PHP
46 lines
960 B
PHP
<?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));
|
|
}
|
|
} |