Commit 563e7c1f authored by 孙磊's avatar 孙磊

代码优化

Signed-off-by: 孙磊's avatarsunlei <sunlei@romens.cn>
parent 97eef00b
......@@ -117,7 +117,7 @@ class AuthorityRoleController extends BaseController
Yii::$app->getResponse()->setStatusCode(201);
} elseif (!$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw new HttpException(500,'添加失败');
throw new HttpException(500, '添加失败');
}
return $model;
}
......@@ -164,7 +164,7 @@ class AuthorityRoleController extends BaseController
if ($model->save() === false && !$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw new HttpException(500,'修改失败');
throw new HttpException(500, '修改失败');
}
Yii::$app->getResponse()->setStatusCode(202);
return $model;
......
......@@ -266,7 +266,7 @@ class BranchController extends BaseController
Yii::$app->getResponse()->setStatusCode(201);
} elseif (!$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw new HttpException(500,'添加失败');
throw new HttpException(500, '添加失败');
}
return $model;
}
......@@ -548,7 +548,7 @@ class BranchController extends BaseController
if ($model->save() === false && !$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw new HttpException(500,'修改失败');
throw new HttpException(500, '修改失败');
}
Yii::$app->getResponse()->setStatusCode(202);
return $model;
......@@ -583,7 +583,7 @@ class BranchController extends BaseController
throw new BadRequestHttpException('没有找到要删除的记录');
} else if ($branchservice->delete() === false) {
// throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');
throw new HttpException(500,'删除失败');
throw new HttpException(500, '删除失败');
}
Yii::$app->getResponse()->setStatusCode(203);
......@@ -1105,7 +1105,7 @@ class BranchController extends BaseController
$model->setAttributes(Yii::$app->getRequest()->post());
if ($model->save() === false && !$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw new HttpException(500,'修改失败');
throw new HttpException(500, '修改失败');
}
return $model;
}
......
......@@ -146,7 +146,7 @@ class BranchServiceTypeController extends BaseController
Yii::$app->getResponse()->setStatusCode(201);
} elseif (!$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw new HttpException(500,'添加失败');
throw new HttpException(500, '添加失败');
}
return $model;
}
......@@ -187,7 +187,7 @@ class BranchServiceTypeController extends BaseController
if ($model->save() === false && !$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw new HttpException(500,'修改失败');
throw new HttpException(500, '修改失败');
}
Yii::$app->getResponse()->setStatusCode(202);
return $model;
......@@ -222,7 +222,7 @@ class BranchServiceTypeController extends BaseController
throw new BadRequestHttpException('没有找到要删除的记录');
} else if ($branchservice->delete() === false) {
// throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');
throw new HttpException(500,'删除失败');
throw new HttpException(500, '删除失败');
}
Yii::$app->getResponse()->setStatusCode(203);
......
......@@ -136,7 +136,7 @@ class TransportInitialPriceController extends BaseController
if ($model->save() === false && !$model->hasErrors()) {
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw new HttpException(500,'修改失败');
throw new HttpException(500, '修改失败');
}
Yii::$app->getResponse()->setStatusCode(202);
return $model;
......@@ -183,7 +183,7 @@ class TransportInitialPriceController extends BaseController
$tempArr = array_slice($rows, 2);
//批量验证门店
$branchModel = new ShopBranch();
$branchInfo = $branchModel->validateBranch($tempArr, 0);
$branchInfo = $branchModel->validateBranch($tempArr, 0);
//若不存在的门店 则返回相关信息
if (isset($branchInfo['CODE'])) {
@unlink($fileInfo['INFO'][0]);
......
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