Formid.php 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\api\controller\wxapp;
  10. use app\api\controller\Controller;
  11. use app\api\model\wxapp\Formid as FormidModel;
  12. /**
  13. * form_id 管理
  14. * Class Formid
  15. * @package app\api\controller\wxapp
  16. */
  17. class Formid extends Controller
  18. {
  19. /**
  20. * 新增form_id
  21. * @param $formId
  22. * @return array
  23. * @throws \app\common\exception\BaseException
  24. * @throws \think\exception\DbException
  25. */
  26. public function save($formId)
  27. {
  28. if (!$user = $this->getUser(false)) {
  29. return $this->renderSuccess();
  30. }
  31. if (FormidModel::add($user['user_id'], $formId)) {
  32. return $this->renderSuccess();
  33. }
  34. return $this->renderError();
  35. }
  36. }