Commit 43f75234 authored by shajiaiming's avatar shajiaiming

fix

parent 7a15756a
...@@ -24,7 +24,7 @@ class GameController extends BaseController ...@@ -24,7 +24,7 @@ class GameController extends BaseController
$address = $post['address'] ?? ''; $address = $post['address'] ?? '';
$nickname = $post['nickname'] ?? ''; $nickname = $post['nickname'] ?? '';
if (empty($address) || empty($nickname)) { if (empty($address) || empty($nickname)) {
return ['code' => -1, 'msg' => '地址和昵称不能为空', 'data' => '']; return ['code' => -1, 'msg' => '地址和昵称不能为空', 'data' => []];
} }
//判断重复 //判断重复
$count = GameUser::find()->where(['nickname' => $nickname])->count(); $count = GameUser::find()->where(['nickname' => $nickname])->count();
...@@ -48,7 +48,7 @@ class GameController extends BaseController ...@@ -48,7 +48,7 @@ class GameController extends BaseController
{ {
$address = Yii::$app->request->post('address', ''); $address = Yii::$app->request->post('address', '');
if (empty($address)) { if (empty($address)) {
return ['code' => -1, 'msg' => '地址不能为空', 'data' => '']; return ['code' => -1, 'msg' => '地址不能为空', 'data' => []];
} }
//todo 获取地址 //todo 获取地址
$address = GameUser::find()->select(['nickname'])->where(['address' => $address])->one(); $address = GameUser::find()->select(['nickname'])->where(['address' => $address])->one();
...@@ -85,7 +85,7 @@ class GameController extends BaseController ...@@ -85,7 +85,7 @@ class GameController extends BaseController
{ {
$address = Yii::$app->request->post('address', ''); $address = Yii::$app->request->post('address', '');
if (empty($address)) { if (empty($address)) {
return ['code' => -1, 'msg' => '地址不能为空', 'data' => '']; return ['code' => -1, 'msg' => '地址不能为空', 'data' => null];
} }
//todo 获取地址 //todo 获取地址
$address = GameUserAddress::find() $address = GameUserAddress::find()
...@@ -95,6 +95,6 @@ class GameController extends BaseController ...@@ -95,6 +95,6 @@ class GameController extends BaseController
if (!empty($address)) { if (!empty($address)) {
return ['code' => 0, 'msg' => 'Succeed', 'data' => $address]; return ['code' => 0, 'msg' => 'Succeed', 'data' => $address];
} }
return ['code' => -1, 'msg' => 'Failed']; return ['code' => -1, 'msg' => '数据为空', 'data' => null];
} }
} }
\ No newline at end of file
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