Commit b740bbe8 authored by shajiaiming's avatar shajiaiming

fix

parent f6ba2756
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace api\controllers; namespace api\controllers;
use common\components\Tools;
use Yii; use Yii;
use common\components\Tools;
use api\base\BaseController; use api\base\BaseController;
use common\models\psources\AirDrop; use common\models\psources\AirDrop;
use common\service\chain33\Chain33Service; use common\service\chain33\Chain33Service;
...@@ -13,6 +13,29 @@ use common\models\psources\AirDropApplyRecord; ...@@ -13,6 +13,29 @@ use common\models\psources\AirDropApplyRecord;
class AirDropController extends BaseController class AirDropController extends BaseController
{ {
public function actionValidateIdentifier()
{
$data = Yii::$app->request->get();
$identifier = $data['identifier'] ?? null;
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;
}
doEnd :
return ['code' => $this->code, 'msg' => $this->msg, 'data' => $this->data];
}
/** /**
* 参于空投申请/空投申请列表 * 参于空投申请/空投申请列表
* @param identifier 树莓派编号 * @param identifier 树莓派编号
......
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