Commit 8846c295 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/airdrop' into develop

parents 46a50893 8d16c9dd
......@@ -142,6 +142,31 @@ class AirDropController extends BaseController
}
/**
* 验证今日是否可领取
* @param identifier 树莓派编号
* @return array
*/
public function actionValidate()
{
$data = Yii::$app->request->get();
$identifier = $data['identifier'] ?? '';
if (false == $identifier) {
$this->code = -1;
$this->msg = 'Validation failed.';
goto doEnd;
}
$redis = Yii::$app->redis_app;
if (true == $redis->exists($identifier)) {
$this->msg = '已达今日领取上限,请明天再来!';
$this->code = -1;
goto doEnd;
}
doEnd :
return ['code' => $this->code, 'msg' => $this->msg, 'data' => $this->data];
}
/**
* 空投领取情况
* @param identifier 树莓派编号
* @param miner_address 矿工地址
......
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