AccidentCasesScoreController.php 876 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace frontend\modules\api\controllers;
  3. use common\components\AjaxException;
  4. use common\services\AccidentCasesScoreConfigService;
  5. use common\services\AccidentCasesScoreService;
  6. use frontend\modules\api\components\BaseAdminController;
  7. use yii\base\InvalidConfigException;
  8. use yii\web\Response;
  9. class AccidentCasesScoreController extends BaseAdminController
  10. {
  11. /**
  12. * 评价打分
  13. * @param $id
  14. * @return Response
  15. * @throws AjaxException
  16. * @throws InvalidConfigException
  17. */
  18. public function actionUpdate($id)
  19. {
  20. if (AccidentCasesScoreConfigService::getAccidentCasesScoreConfigUpdate()) {
  21. throw new AjaxException("打分配置正在更新中,请稍后打分!");
  22. }
  23. AccidentCasesScoreService::updateById($id, $this->getAllParams(), $this->userInfo);
  24. return $this->asJson();
  25. }
  26. }