Commit 5da59ad8 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/airdrop' into 'master'

领取验证 See merge request !328
parents 73fb9a2f 7134fe19
......@@ -127,6 +127,10 @@ class AirDropController extends BaseController
public function actionBatchDraw()
{
$this->code = -1;
$this->msg = '请求方式错误!';
goto doEnd;
if (!Yii::$app->request->isPost) {
$this->code = -1;
$this->msg = '请求方式错误!';
......@@ -196,6 +200,14 @@ class AirDropController extends BaseController
goto doEnd;
}
$redis = Yii::$app->redis_app;
$is_locked = $redis->setnx($data['identifier'], strtotime('23:59:59') - time());
if (!$is_locked) {
$this->msg = '已达今日领取上限,请明天再来!';
$this->code = -1;
goto doEnd;
}
$record->draw_status = AirDropApplyRecord::STATUS_DRAWING;
if (false == $record->save()) {
$this->code = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment