Commit 3db34034 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

fix See merge request !428
parents cf66bd4c 278c5d0e
......@@ -188,6 +188,22 @@ class AirDropController extends BaseController
$this->msg = 'Validation failed.';
goto doEnd;
}
$air_drop = AirDrop::find()->select('id')->where(['identifier' => $identifier])->one();
if (empty($air_drop) || empty($air_drop->record)) {
$this->code = -1;
$this->msg = '设备号错误,请重新确认.';
goto doEnd;
}
$amount = AirDropApplyRecord::find()
->where(['apply_id' => $air_drop['id'], 'draw_status' => AirDropApplyRecord::STATUS_DRAW_SUEEESS])
->sum('amount');
if ($amount >= 1000) {
$this->data = false;
goto doEnd;
}
$redis = Yii::$app->redis_app;
if (true == $redis->exists($identifier)) {
$this->data = false;
......
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