Commit 8d16c9dd authored by shajiaiming's avatar shajiaiming

加入验证今日领取状态

parent c75f9fc6
...@@ -142,6 +142,31 @@ class AirDropController extends BaseController ...@@ -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 identifier 树莓派编号
* @param miner_address 矿工地址 * @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