Commit 3877d975 authored by shajiaiming's avatar shajiaiming

fix

parent 25236481
......@@ -18,27 +18,29 @@ class AirDropController extends BaseController
$data = Yii::$app->request->get();
$identifier = $data['identifier'] ?? null;
$miner_address = $data['miner_address'] ?? null;
if (false == $identifier || false == $miner_address) {
if (false == $identifier) {
$this->code = -1;
$this->msg = '设备号错误,请重新输入.';
goto doEnd;
}
// $exist = AirDropRulePool::find()->where(['identifier' => $identifier])->one();
// if (false == $exist || false == $exist->rule) {
// $this->code = -1;
// $this->msg = '设备号错误,请重新输入.';
// goto doEnd;
// }
$exist = AirDrop::find()->where(['identifier' => $identifier, 'miner_address' => $miner_address])->one();
$exist = AirDropRulePool::find()->where(['identifier' => $identifier])->one();
if (false == $exist || false == $exist->rule) {
$this->code = -1;
$this->msg = '设备号错误,请重新输入.';
goto doEnd;
}
$miner_address = $data['miner_address'] ?? null;
if (!empty($miner_address)) {
$exist = AirDrop::find()->where(['identifier' => $identifier, 'miner_address' => $miner_address])->one();
if (false == $exist) {
$this->code = -1;
$this->msg = '设备号和矿工地址不匹配,请重新确认.';
goto doEnd;
}
}
doEnd :
return ['code' => $this->code, 'msg' => $this->msg, 'data' => $this->data];
}
......
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