Receipt.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\controller;
  13. /**
  14. * 发票模块控制器
  15. * Class Setting
  16. * @package app\store\controller
  17. */
  18. class Receipt extends Controller
  19. {
  20. /**
  21. * 商城公共设置(仅展示可公开的信息)
  22. * @return array|\think\response\Json
  23. * @throws \think\db\exception\DataNotFoundException
  24. * @throws \think\db\exception\DbException
  25. * @throws \think\db\exception\ModelNotFoundException
  26. */
  27. public function add()
  28. {
  29. $service = new \app\api\model\Receipt();
  30. //dd($this->postData());
  31. $res = $service->add($this->postData());
  32. if ($res === 201){
  33. return $this->renderError('您已经申请过了');
  34. }
  35. if ($res == false){
  36. return $this->renderError('系统繁忙');
  37. }
  38. return $this->renderSuccess(compact('res'));
  39. }
  40. }