Commit 7134fe19 authored by shajiaiming's avatar shajiaiming

领取验证

parent 3797b536
......@@ -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